November 28th, 2012, 02:43 PM
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:
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?
ctrl_key = [64, 128, 305, 306, 4160, 4224]
if pygame.key.get_mods in ctrl_key: