0

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?

martineau
  • 119,623
  • 25
  • 170
  • 301
Toothpick Anemone
  • 4,290
  • 2
  • 20
  • 42
  • https://stackoverflow.com/questions/7529991/disable-or-lock-mouse-and-keyboard-in-python –  Nov 09 '19 at 03:54
  • The problem with the question you linked to is that it blocks all keyboard input. We don't want to do that. We want to block all keyboard input except the escape key on most keyboard devices, but then allow all input from one particular keyboard device. That is very different from blocking all input from all keyboards. – Toothpick Anemone Nov 10 '19 at 23:24
  • Is a hard one. I think the possibility will be just to make a time break for this or to let them to finish the job and then to unlock the keys ... I never tried something like this so I do not have so much experience –  Nov 12 '19 at 11:14

0 Answers0