2

I would like to detect what modifiers are pressed on startup of my program. So far I haven't found any good libraries or methods for that. What I found are

I am looking for a way to detect if modifiers are pressed, that works without root, without GUI, and at startup. Any help is greatly appreciated, thanks.

Chris Stenkamp
  • 337
  • 1
  • 2
  • 15
  • Would this be of use? https://stackoverflow.com/questions/13207678/whats-the-simplest-way-of-detecting-keyboard-input-in-python-from-the-terminal/13207724 – Filip Mar 19 '20 at 12:11
  • Something like a keylogger, but with some changes to fit your situation better. – Filip Mar 19 '20 at 12:14
  • Unfortunately not. Basically all answers rely on termios for Unix, and that does not detect modifiers like CTRL, so that doesn't work – Chris Stenkamp Mar 19 '20 at 18:02
  • 1
    a pyxhook Keylogger also doesn't work, as it cannot detect keys pressed before the actual program started – Chris Stenkamp Mar 19 '20 at 18:07

0 Answers0