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
_______________________________________________
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