Held Hotkey for holding two keys Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
BriHecato
Posts: 124
Joined: 18 Jul 2017, 07:17

Held Hotkey for holding two keys

17 Oct 2017, 04:34

I'm used to panning 2D canvas by holding and dragging middle mouse button (like AutoCAD, Office etc..)

But got this old and strange written CAD/CAM software for waterjet where panning is executed only by holding Left Alt, then holding Left mouse Button and dragging.

So I need some "translation" for it, but this approach doesnt work:

Code: Select all

MButton::
while, getkeystate("MButton", "p")
{
Send, {Alt}
Click, Down
}
Return,
When I've changed to {Alt down}, it started to work but it was very jumpy panning (not smooth) like script constantly click and release. In addition panning was still "ON" after release od MButton....
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Held Hotkey for holding two keys

17 Oct 2017, 05:16

[OffTopic]
Kinda coincidence as I've found/watched that video last night :)
https://m.youtube.com/watch?v=1upe3TzWLiI
[/OffTopic]

What's the name of that software?
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Held Hotkey for holding two keys  Topic is solved

17 Oct 2017, 13:11

Code: Select all

MButton::
    Send, {Alt Down}{LButton Down} ; Send DOWN state for ALT and LBUTTON
    KeyWait, MButton ; Wait for MBUTTON to be relased
    Send, {Alt Up}{LButton Up} ; SEND UP state for ALT and LBUTTON
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee and 145 guests