I am creating a bot in Python automating some keyboard and mouse actions for specific apps. I am looking for a way to block user input (mouse and if possible keyboard), but still be able to send hotkeys from pynput library's keyboard module at the same time while the user input block is active.
I know windll BlockInput can block both keyboard and mouse inputs from the user, but it also blocks pynput's keyboard press event as well.
ok = windll.user32.BlockInput(True) #enable block
key_presser.press(keyboard.Key.f12)
ok = windll.user32.BlockInput(False) #disable block