autohotkey how to remap mouse left click hold action -


i change input of mouse when click left button , hold it. usual left click action must remain. let left click behave is, if click , hold, let perform holding keyboard button p (or other keyboard button).

currently got like:

~lbutton::  sleep 100 while (getkeystate("lbutton","p")) {         send, {m down}  } send, {m up}  return 

i trying figure out how remove click action when want spam letter m.

the following should want:

threshold := 100 lbutton::     coordmode, mouse, screen ; needed prevent issues when clicking changes focus     mousegetpos, mxclick, myclick ; save mouse position before sleep      sleep % threshold      ; mouse up, normal click     if (!getkeystate("lbutton", "p")) {         mousegetpos, mxcurr, mycurr ; save mouse position before click         click %mxclick%, %myclick%         mousemove, %mxcurr%, %mycurr% ; restore mouse position         return     }      while (getkeystate("lbutton", "p")) {         send {m down}         sleep 30     }     send {m up} return 

you can play threshold, try different values , see how works. mousegetpos , mousemove might not needed, depends on want happen.

currently doubleclick little problematic, need doubleclick slower threshold fast enough register doubleclick. can solved, tell me if it's need.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -