mouse icon indicating copy to clipboard operation
mouse copied to clipboard

How can I convert below Autohotkey algorithm to python script?

Open trappedinspacetime opened this issue 5 years ago • 0 comments

First of all thank you for developing this tool. In Windows I used an Autohotkey script to use a mouse with worn-out switches. As far as I understand it mouse tool can do it. I used to run the mouse with the below script.

 LButton::  ;blocks  the left button event completely
 If (A_TimeSincePriorHotkey < 100) ;detects if a faulty hyperclick event occured
 Return ; if it's a faulty  hyperclick, it keeps blocking the left button events
 sendinput {LButton down} ; else send decent simulated click down event
 KeyWait, LButton ; waits for another button event
 sendinput {LButton up} ; send simulated button up event
 Return

It simply filters repititive hyper click events. It works very well in Windows but Linux missing such a tool.

Algorithm should be:

 block  the left button event completely
 if faulty repititive hyperclick events occur less than 200 ms, return
 (if it's a faulty  hyperclick,  keep blocking the left button events)
 else send decent simulated click down event
 wait for another button event which is higher than 200ms timeout
 send simulated button up event
 return

Is it possible with this tool? Autohotkey script

trappedinspacetime avatar Dec 04 '19 11:12 trappedinspacetime