that doesn't seem to be working properly.

I've got an HBox filled with buttons and I'm trying to use the joystick to go 
back and forth across the list.

i got it working last night, actually, although I wasn't aware of gtk.keysym. 
apparently, that's only mentioned once on pygtk.org in an example. I had to use 
the interactive prompt and help(gtk.keysym) to get info in it.

your example will work if I set a hardware_keycode in addition to the keyval. 
I'm not overly excited about hard-coding numbers in like that, in case 
something changes or some foreign keyboard layout is different and it winds up 
screwing up.

is there something similar to keysym for finding hardware_keycode?

thanks for the help!


...spike


On Thursday, December 22, 2005, at 05:01AM, Nikos Kouremenos <[EMAIL 
PROTECTED]> wrote:

>this createes a keypress with key up
>
>event = gtk.gdk.Event(gtk.gdk.KEY_PRESS)
>event.keyval = gtk.keysyms.Up
>event.state = 0
>event.time = 0 # assign current time
>
>
>then u just do:
>
>the_widget_I_want_to_catch_this_event.emit('key_press_event', event)
>
>On 12/21/05, spike grobstein <[EMAIL PROTECTED]> wrote:
>> I've got this project I'm working on where I've implemented joystick control 
>> (pyjsw) for the GUI and, depending on what's going on in the app, I'd like 
>> to have the joystick events handled differently.
>>
>> so I've got a thread that runs in the background and checks for joystick 
>> updates and then calls methods based on that, but I'd rather spoof 
>> keypresses. ie- I'd like to spoof an arrow-up or arrow-down rather than 
>> figuring out that a treeview is focused, then use code to figure out how to 
>> navigate up and down the list.
>>
>>
>> ...spike
>> _______________________________________________
>> pygtk mailing list   [email protected]
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>>
>
>
>--
>Nikos Kouremenos | Jabber ID: [EMAIL PROTECTED] | 
>http://members.hellug.gr/nkour
>
>




...spike
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to