I\'ve created a python script in which an event needs to be executed each time I press the Super (or WinKey) on my keyboard.
How can one achieve this without the pyt
My previous answer apparently was completely wrong, sorry. I think the correct approach would be to read from /dev/input/event1 (?)
This short test showed scancodes for me, even if the terminal did not have focus:
from struct import unpack
port = open("/dev/input/event1","rb")
while 1:
a,b,c,d = unpack("4B",port.read(4))
print a,b,c,d
I do not know if /dev/input/event1 is always the keyboard or how to determine which one is, but at least for me it worked