November 28th, 2012, 01:43 PM
Join Date: Nov 2012
Time spent in forums: 2 h 28 m 54 sec
Reputation Power: 0
Pygame modifier keys differ from computer to computer?
I've been working on a simple program in pygame which uses pygame.key.get_mods(), but I lose functionality of my modifier keys when I run the program on different computers.
print(pygame.key.get_mods()) reveals different values for the CTRL key on various computers. Some of the ones that have come up:
I've temporarily worked around this by creating a list ctrl_key:
ctrl_key = [64, 128, 305, 306, 4160, 4224]
if pygame.key.get_mods in ctrl_key:
But I assume that there is a much simpler way to detect the CTRL key modifier on various computers. Can anyone point me in the right direction?