<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Erik,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>In pygame, we are using the keys</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>pygame.K_KP9,  #KP_Page_Up</DIV><DIV>pygame.K_KP3,  #KP_Page_Down</DIV><DIV>pygame.K_KP1,  #KP_End</DIV><DIV>pygame.K_KP7,  #KP_Home</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>which (I believe) correspond to</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>pygame.K_UP,</DIV><DIV>pygame.K_DOWN,</DIV><DIV>pygame.K_RIGHT,</DIV><DIV>pygame.K_LEFT,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I would assume the constants are similarly named for gtk.  Hope this helps,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Julius</DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>---------------------------------------------------------------------------------------</DIV><DIV>Please Reply to My Permanent Address: <A href="mailto:julius@younglucks.com">julius@younglucks.com</A></DIV><DIV><A href="http://www.openwetware.org/wiki/User:Julius_B._Lucks">http://www.openwetware.org/wiki/User:Julius_B._Lucks</A></DIV><DIV>----------------------------------------------------------------------------------------</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN></SPAN></SPAN> </DIV><BR><DIV><DIV>On Aug 21, 2007, at 11:03 PM, Erik Blankinship wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">How should one go about listening to the game button keys?<BR><BR>I tried connecting a 'key-press-event' to my activity, and I get back  <SPAN style="font-weight: bold;"><SPAN style="font-family: courier new,monospace;"> <SPAN style="font-weight: bold;"></SPAN>^[[4~</SPAN> </SPAN>as the check key and <SPAN style="font-weight: bold;"><SPAN style="font-family: courier new,monospace;">^[[6~ </SPAN></SPAN>as the X key. <BR><BR>Is there a better way than string matching these strange characters to know which game key has been pressed? <BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Sugar mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Sugar@lists.laptop.org">Sugar@lists.laptop.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.laptop.org/listinfo/sugar">http://lists.laptop.org/listinfo/sugar</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>