1

I want to make a smart keyboard layout on Windows with Python that determines the letter to be typed when a key is hit, after processing is done by the program. I am wondering which libraries and functions to use in order to first read the initial keypress, block its initial output, and then simulate the keystroke that the program determines is best. I have been having the most difficulty finding a library that can both read and then stop a keystroke from being typed.

Jack N
  • 324
  • 2
  • 14
  • The only module in that direction I know of is `pynput`. Other than that this answer has some insights: https://stackoverflow.com/questions/33863921/detecting-a-keypress-in-python-while-in-the-background/33864704 – Dschoni Aug 13 '20 at 13:56
  • @Dschoni I have tried using pynput, but I was not able to find a way to block the initial keystroke. Please let me know if you know of a way to do this. – Jack N Aug 13 '20 at 13:59
  • I remember reading something here: https://github.com/boppreh/keyboard/issues/22 and here: https://python.developreference.com/article/27429135/Python+disable+redirect+keyboard+input – Dschoni Aug 13 '20 at 14:08

0 Answers0