boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.74k stars 432 forks source link

keyboard.suppress blocks keyboard.is_pressing #628

Open S0meM opened 5 months ago

S0meM commented 5 months ago

When you hook a function with suppress=True, and the function is using keyboard.is_pressing() with any value, it returns false. This is what I mean: ` import keyboard

def keys(event): if event.event_type == keyboard.KEY_DOWN: if keyboard.is_pressed('a'): print('You are pressing A') else: print('You are not pressing A')

keyboard.hook(keys, suppress=True)

while True: continue `