[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] KMOD_CTRL



Mauricio Gomes wrote:

I am looking to customize my Freevo system to be controlled through an IR
remote that sends ASCII key commands to the machine. Freevo uses pygame for
keyboard input and mailing their list has provided me with no results. So I
will try here.

I am not a Python programmer and so I am not too familiar with all the data
types. It seems as though Freevo uses a dictionary to map keys like
bleh.K_f to whatever the corresponding Freevo command is. My question is
how can I modify this so that instead of just the 'f' key, I can use the
modifier KMOD_CTRL + K_F?

Knowing this will allow people to use their GCT-Allwell remotes with
PyGame/Freevo. Thanks in advance.


Mauricio Gomes


maybe something like:

if event.type == KEYDOWN:
if event.key == K_f:
mods = pygame.key.get_mods() # an integer representing the
if mods & (K_RCTRL | K_LCTRL): # pressed modifier keys (shift, alt, ctrl...)
do_stuff()


i bet the indentation is off, but you should get what i mean...