Entropy's picture

KeyboardEvents called incorrectly in Ubuntu 9.04

Project:The Open Toolkit library
Version:0.9.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Each separate keypress should generate one KeyUp KeyboardEvent when the key is first pressed and one KeyDown event when it's the key's released. This seems to work fine in XP/.NET, but in Ubuntu the events are called in time with a delayed repeat (ie. like holding down a letterrrrrrrrrrrrrrr in a text editor), with each KeyUp event immediately preceding a KeyDown event.

This means that what appears to be one sustained keypress actually manifests as a repeated set of KeyDown/KeyUp events. This causes confusion for game or application events which require keys to be double-tapped or pressed in combination.

See the attached solution for a demo.

AttachmentSize
keypress.7z309.69 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» confirmed

I can confirm this.

the Fiddler's picture

#2

Version:0.9.7» 0.9.x-dev
Status:confirmed» fixed

X11Input now calls XAutoRepeatOff to disable keyboard autorepeat. Fix commited in rev. 1810.

Mincus's picture

#3

Just tested on Xubuntu 9.04, this is remaining off after the OpenTK application closes.
I now have no auto-repeat.
Presumably calling XAutoRepeatOn as the application closes would fix this.

Just as a note: 9.04 installs the OpenAL library as libopenal.so.1, the .config file has libopenal.so.0 and so needs changing before OpenAL support works, should I open an issue for that, or is it going to be Ubuntu specific?

the Fiddler's picture

#4

I just encountered the same issue. Should be fixed in rev. 1814 - can you please verify that it works correctly now?

OpenTK 0.9.8 will ship with libopenal.so.1 as the default configuration.

Mincus's picture

#5

It's working outside of OpenTK and after the application exits.
Quick application to test it seems to indicate all is working well.

OpenAL update is good as well.

the Fiddler's picture

#6

Thanks for testing. Current implementation relies on XkbSetDetectableAutoRepeat, which seems to be ignored when running inside VirtualBox (even though the function indicates success).

Still, since it's working on real hardware I'll leave things as they are.

the Fiddler's picture

#7

Status:fixed» closed

Closing issues resolved in 0.9.8.