On 8/22/07, Julius B. Lucks <[EMAIL PROTECTED]> 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
>
> pygame.K_UP,
> pygame.K_DOWN,
> pygame.K_RIGHT,
> pygame.K_LEFT,
>
> I would assume the constants are similarly named for gtk. Hope this
> helps,
>
> Julius
>
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 )
#check: KP_End
if (keyname == 'KP_Page_Up'):
print("gamekey O")
elif (keyname == 'KP_Page_Down'):
print("gamekey X")
elif (keyname == 'KP_End'):
print("gamekey CHECK")
elif (keyname == 'KP_Home'):
print("gamekey SQUARE")
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?
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar