May-31-2020, 09:22 PM
(May-31-2020, 09:10 PM)DreamingInsanity Wrote: If this doesn't work I'm sorry I couldn't help! But although I keep saying, in theory this should work.
import win32api def button1_pressed(): # Returns true if the left mouse button is pressed button1_state = win32api.GetAsyncKeyState(0x01) return bool(button1_state) def button2_pressed(): # Returns true if the right mouse button is pressed button2_state = win32api.GetAsyncKeyState(0x02) return bool(button2_state) def button3_pressed(): # Returns true if the M button is pressed button3_state = win32api.GetAsyncKeyState(0x4D) return bool(button3_state) isMPressed = False while True: isMPressed = True if button3_pressed() else False while button1_pressed() and button2_pressed(): print("do some") while button3_pressed() and not isMPressed: # Only if it is pressed after button1 and button2 are pressed isMPressed = False print("do some2") if button2_pressed() == 0: break # this only breaks the inner while loopIt's a simple variation from last time however if you hold down 'M' then the mouse buttons, rather than printing nothing, it will print 'do some'.
I don't know if this will be a issue to you but if you are holding down 'M' then button 1 and button 2, it will print 'do some'. If you let go of 'M' and press it again, it will print 'do some' rather than 'do some2'. This may be how you wan't it to work, I'm not sure.
If you let go of 'M' and press it again, it will print 'do some' rather than 'do some2'.
Yes it woulb be a problem, Is there a way to fix it?
If I hold M + button 1 + button 2 (in order) than realease M and press again it would be great if print "do some2".
I did not thougth it before, my bad again.