Jan-30-2021, 08:51 PM
Fellows, I need some help here. Im trying to do a code that read the time between lefts clicks while right buttom is pressed. If the clicking is slow it will do thing1. If meduim velocity thing 2 and if the clicking is fast will do thing 3.
Would be great if the time count was 100% accurate
What I have done so far:
Would be great if the time count was 100% accurate
What I have done so far:
import win32api import time def lmb_down(): # Returns true if the left mouse button is pressed lmb_state = win32api.GetKeyState(0x01) return lmb_state < 0 def rmb_down(): # Returns true if the right mouse button is pressed rmb_state = win32api.GetKeyState(0x02) return rmb_state < 0 def main_function(): start = time.time() while rmb_down(): while lmb_down(): end = time.time() elapsed = end - start if elapsed > 0.4: print(elapsed, 'slow click') elif elapsed >= 0.00000000001 <= 0.4: print(elapsed, 'medium click') elif elapsed < 0.00000000001: print(elapsed, 'fast clicking') while True: main_function()appreciate any help