autohotkey - Unable to emulate mouse buttons with combination keys -


i'd assign key combinations mouse buttons.

i 'm going use 'vk1dsc07b' virtual prefix key, , i'll use 'v' lbutton, 'c' mbutton , 'x' rbutton.

i tried several ways, failed. click, however, coudn't drag properly. once tried drag object, pointer grab , release every 0.1 seconds. problem is, guess, key events sent repeatedly unlike mouse buttons'.

i'm looking code acts following:

  1. keep mouse button pressed continuously, not repeatedly, while i'm pressing combination keys
  2. change mouse button when release 1 key, other virtual prefix key, of combination keys

here 1 of codes:

vk1dsc07b::return ; deactivate 'muhenkan' key in order use prefix key vk1dsc07b & v::click,l,d return vk1dsc07b & c::click,m,d return vk1dsc07b & x::click,r,d return vk1dsc07b & v up::click,l,u return vk1dsc07b & c up::click,m,u return vk1dsc07b & x up::click,r,u return 

another sample:

vk1dsc07b::return ; deactivate 'muhenkan' key in order use prefix key vk1dsc07b & v::send {blind}{lbutton down} vk1dsc07b & c::send {blind}{mbutton down} vk1dsc07b & x::send {blind}{rbutton down} vk1dsc07b & v up::send {blind}{lbutton up} vk1dsc07b & c up::send {blind}{mbutton up} vk1dsc07b & x up::send {blind}{rbutton up} 

maybe of don't have 'vk1dsc07b' key, please replace key.

glad hear idea:)

sincerely,

what trying achieve remapping two keys one. autohotkey documentation says:

although pair of keys cannot directly remapped single key (e.g. it's invalid write & c::b), effect can achieved explicitly adding , down hotkeys [link]

so, second solution of yours should work:

vk1dsc07b::return    ; don't need line. vk1dsc07b deactiated default because of other hotkeys vk1dsc07b & v::send {blind}{lbutton down} vk1dsc07b & v up::send {blind}{lbutton up} ; , need `{blind}` keyword here, you?? 

, doesn't. works 'normal' keys send {a down}. problem when hold down vk1dsc07b & v, {lbutton down} sent repeatedly. leads "the pointer grab , release every 0.1 seconds". so, we'll have way, trying have {lbutton down} sent once, when hotkey triggered.

i came following solution stores hotkey trigger in variable:

ltriggered := false mtriggered := false rtriggered := false  vk1dsc07b  & v:: if(!ltriggered) {     send {lbutton down}     ltriggered := true } return vk1dsc07b  & v up:: send {lbutton up} ltriggered := false return  vk1dsc07b  & c:: if(!mtriggered) {     send {mbutton down}     mtriggered := true } return vk1dsc07b  & c up:: send {mbutton up} mtriggered := false return  vk1dsc07b  & x:: if(!rtriggered) {     send {rbutton down}     rtriggered := true } return vk1dsc07b  & x up:: send {rbutton up} rtriggered := false return 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -