Summary: | There is no trivial way to make a difference between "useful" events and "useless" release events generated by default by XOrg | ||
---|---|---|---|
Product: | [JogAmp] Newt | Reporter: | Julien Gouesse <gouessej> |
Component: | x11 | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | gouessej, rami.santina, rob.hatcherson |
Priority: | --- | ||
Version: | 1 | ||
Hardware: | All | ||
OS: | linux | ||
URL: | http://forum.jogamp.org/NEWT-KeyEvents-behaving-odd-in-Linux-td4021912.html | ||
Type: | --- | SCM Refs: |
jogl 646714d3dab87396b9a3119bf90ca26e0b1c97ce
jogl 8777a6f0b8d5aa7c97643c68c4641593c6fa2c46
jogl b008de41549e38aebdfcb7b094046235a8dde72f
jogl 2f9c77a347b76bebdadd4bec1ac92aa7ab72365f
|
Workaround: | --- |
Description
Julien Gouesse
2012-07-02 13:40:34 CEST
How about we do solution 3 + add these useless auto-repeat events on other platforms ? Then we would also have the same behavior .. and the information required. How about OSX ? On Windows we can simply inject the release event as auto-repeat, on X11 as done in you link. Good stuff ~Sven (In reply to comment #1) > How about we do solution 3 + add these useless auto-repeat events on other > platforms ? > Then we would also have the same behavior .. and the information required. That's better, good idea, it would be more consistent. > > How about OSX ? > I don't know Mac OS X a lot. I can investigate tomorrow if you want. > On Windows we can simply inject the release event as auto-repeat, > on X11 as done in you link. Why not injecting them as "useful" events under Windows instead of marking them all useless? > > Good stuff > > ~Sven Thanks. Maybe there are auto-repeat mechanisms under Windows for accessibility but I don't know its APIs a lot. http://jogamp.org/git/?p=jogl.git;a=commit;h=646714d3dab87396b9a3119bf90ca26e0b1c97ce com.jogamp.newt.event.KeyEvent: Key events are delivered in the following order: 1 EVENT_KEY_PRESSED 2 EVENT_KEY_RELEASED 3 EVENT_KEY_TYPED In case the native platform does not deliver keyboard events in the above order or skip events, the NEWT driver will reorder and inject synthetic events if required. Besides regular modifiers like InputEvent##SHIFT_MASK etc., the InputEvent.AUTOREPEAT_MASK bit is added if repetition is detected. Hope this suits us .. and matches your expectations. Completed .. w/ commit 8777a6f0b8d5aa7c97643c68c4641593c6fa2c46 (In reply to comment #4) > Completed .. w/ commit 8777a6f0b8d5aa7c97643c68c4641593c6fa2c46 Thank you very much. I will look at the modifications, test them and modify Ardor3D (remove our dirty hacks). We have figured out that the event sequence w/ auto-repeat is not consistent. Note Event order: EVENT_KEY_PRESSED EVENT_KEY_RELEASED EVENT_KEY_TYPED D = pressed, U = released, T = typed 0 = normal, 1 = auto-repeat D(0), [ U(1), T(1), D(1), U(1) T(1) ..], U(0) T(0) The idea is if you mask out auto-repeat in your event listener you just get one long pressed key D/U/T triple. Adding unit tests for typed key order w/ and w/o auto repeat. Incl. fix for Windows. Auto-Repeat tests recognizes whether auto-repeat could be triggered by AWT Robot. The latter is not possible on Windows, hence manual testing was required on this platform. Impact: X11, Windows and OSX produce proper key sequence incl. auto-repeat modifier mask. http://jogamp.org/git/?p=jogl.git;a=commit;h=b008de41549e38aebdfcb7b094046235a8dde72f Enhanced w/ multiple key support, see Bug 631 and: <http://jogamp.org/git/?p=jogl.git;a=commit;h=2f9c77a347b76bebdadd4bec1ac92aa7ab72365f> |