[sugar] key-press-event' to listen to game pad keys?

Julius B. Lucks julius at younglucks.com
Wed Aug 22 09:41:09 EDT 2007


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

------------------------------------------------------------------------ 
---------------
Please Reply to My Permanent Address: julius at younglucks.com
http://www.openwetware.org/wiki/User:Julius_B._Lucks
------------------------------------------------------------------------ 
----------------



On Aug 21, 2007, at 11:03 PM, Erik Blankinship wrote:

> How should one go about listening to the game button keys?
>
> I tried connecting a 'key-press-event' to my activity, and I get  
> back  ^[[4~ as the check key and ^[[6~ as the X key.
>
> Is there a better way than string matching these strange characters  
> to know which game key has been pressed?
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20070822/ddb19e4f/attachment.htm 


More information about the Sugar mailing list