"When you receive a key release and the next event is a key press of the same key combination, then it's auto-repeat and the key wasn't acutally released."
That is a hack and there is no guarantee that key repeat is implemented in this way. On Wed, Jan 2, 2013 at 9:18 AM, Tristam MacDonald <[email protected]> wrote: > On Tue, Jan 1, 2013 at 12:03 PM, Jukkis Virtanen > <[email protected]> wrote: >> >> On pyglet's documentation it is stated that >> >> The Window.on_key_press and Window.on_key_release events are fired when >> any key on the keyboard is pressed or released, respectively. These events >> are not affected by "key repeat" -- once a key is pressed there are no >> more >> events for that key until it is released. >> >> >> However when the Unity's keyboard setting called "Key presses repeat when >> key is held down" is selected, pyglet (1.2alpha1) will repeat on_key_press >> and on_key_release when a key remains pressed. >> >> This unintended behavior can be tested by the following script a toggling >> the setting: >> >> import pyglet >> >> window = pyglet.window.Window() >> >> @window.event >> def on_key_press(symbol, modifiers): >> print "key press" >> >> @window.event >> def on_key_release(symbol, modifiers): >> print "key release" >> >> pyglet.app.run() >> >> >> Is there a way to override key repeat for a single window? Any other >> workaround is also welcome. >> >> This setting is on by default and it is not pleasant for a game to request >> setting it off. > > Stackoverflow has a fairly detailed discussion of how to implement ignoring > key repeat under X: > > http://stackoverflow.com/questions/2100654/ignore-auto-repeat-in-x11-applications > > Presumably, someone needs to tweak pyglet's input handling along similar > lines. > > -- > Tristam MacDonald > Software Development Engineer, Amazon.com > http://swiftcoder.wordpress.com/ > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pyglet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
