[sugar] key-press-event' to listen to game pad keys?
Thu Aug 23 17:55:22 EDT 2007
On 8/22/07, Julius B. Lucks <julius at younglucks.com> wrote:
> Hi Erik,
> In pygame, we are using the keys
> pygame.K_KP9, #KP_Page_Up
> pygame.K_KP3, #KP_Page_Down
> pygame.K_KP1, #KP_End
> pygame.K_KP7, #KP_Home
> which (I believe) correspond to
> I would assume the constants are similarly named for gtk. Hope this
Thanks for your suggestion Julius. I've modified my code:
def _keyPressEventCb( self, widget, event ):
keyname = gtk.gdk.keyval_name(event.keyval)
print( "keyname:", keyname )
if (keyname == 'KP_Page_Up'):
elif (keyname == 'KP_Page_Down'):
elif (keyname == 'KP_End'):
elif (keyname == 'KP_Home'):
The maddening part is that sometimes I launch a sugar activity and this
works: keyname is equal to 'KP_Page_Down', etc.
But sometimes it doesn't work and Ikeyname is ^[[4~, etc. instead.
To whom do I file this in trac?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel