I have written a program which opens up adobe acrobat and rapidly clicks a bunch of buttons in the user-interface. The program also types some stuff. The problem is that if a user accidentally presses a keyboard key, or twitches the mouse while the program is running, then it can mess-up the results.
The desired behavior is to to suppress/ignore input from all keyboards and mice but one pair. The escape key will still be allowed on all system keyboards. The non-disabled keyboard and mouse are virtual, not physical. This non-disabled mouse and keyboard will do all of the procedural-generated clicking and typing. If any keyboard (including disabled ones) has an escape key press event, that input will not be suppressed. I will bind some sort of "pause program" feature to it.
You may assume that the os is Windows. How do we write code in python for this?