#2998 NORM Trial-3: game key key-press-events not consistent in sugar
Zarro Boogs per Child
bugtracker at laptop.org
Fri Aug 24 06:52:16 EDT 2007
#2998: game key key-press-events not consistent in sugar
--------------------+-------------------------------------------------------
Reporter: erikb | Owner: jg
Type: defect | Status: new
Priority: normal | Milestone: Trial-3
Component: sugar | Version: Build 542
Keywords: | Verified: 0
--------------------+-------------------------------------------------------
I connect a 'key-press-event' to my activity, and handle the callback like
this:
{{{
def _keyPressEventCb( self, widget, event ):
keyname = gtk.gdk.keyval_name(event.keyval)
print( "keyname:", keyname )
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")
}}}
Sometimes the keyname variable is 'KP_Home', etc., as expected, but
sometimes I get nonsense such as
{{{
^[[6~
}}}
as the X key.
Then I quit and restart the same sugar activity and it works. Then I
relaunch and I get nonsense... it seems to be luck of the draw when I
launch.
Workaround is to match on both nonsense and expected strings, but a
solution would be preferable.
--
Ticket URL: <https://dev.laptop.org/ticket/2998>
One Laptop Per Child <http://laptop.org/>
More information about the Bugs
mailing list