1

I am currently coding a program, with the library 'keyboard' in python 3 on Debian.

So if i hold down a Key. The keyboard-library gets multiple KeyDownEvents instead of one at KeyPress but I only want the first event. Is there anyway to suppress the auto-repeat?

I have already tried multiple terminal commands in python which should stop the keyboard auto-repeat but that mostly only works for printable Chars but I also need only 1 event if for example shift is pressed
My conclusion is that the terminal commands don't effect the keyboard library at all.

Any ideas?

Best regards

Anonym
  • 11
  • 1

1 Answers1

0

If you're okay with making it a system-wide change, you can turn off key repeat with:

import os
os.system('xset r off')

You can change it back on program exit with:

os.system('xset r on')
Micah Danger
  • 104
  • 4