# HG changeset patch # User Daniel Blaukopf # Date 1401996171 -10800 # Thu Jun 05 22:22:51 2014 +0300 # Node ID 66f32c1b819c4d9b9753d41571a9842ae80a6b3a # Parent 3308d6a77846e3dedc1beb2952984f5b8572202a RT-37425: [Monocle] key events on udev input path don't work correctly on odroid diff --git a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/util/IntSet.java b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/util/IntSet.java --- a/modules/graphics/src/main/java/com/sun/glass/ui/monocle/util/IntSet.java +++ b/modules/graphics/src/main/java/com/sun/glass/ui/monocle/util/IntSet.java @@ -82,13 +82,14 @@ return elements[index]; } - /** Adds to the set "dest" values that are not in the set "compared". */ + /** Adds to the set "dest" values that in this set but are not in the set + * "compared". */ public void difference(IntSet dest, IntSet compared) { int i = 0; int j = 0; while (i < size && j < compared.size) { int a = elements[i]; - int b = elements[j]; + int b = compared.elements[j]; if (a < b) { // our set has a value that is not in "compared" dest.addInt(a); diff --git a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/USKeyboardTest.java b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/USKeyboardTest.java --- a/tests/system/src/test/java/com/sun/glass/ui/monocle/input/USKeyboardTest.java +++ b/tests/system/src/test/java/com/sun/glass/ui/monocle/input/USKeyboardTest.java @@ -154,4 +154,50 @@ TestLog.waitForLog("Key released: CAPS"); } + /** Key presses and releases are alowed to overlap */ + @Test + public void testPressReleaseOrder() throws Exception { + TestApplication.showFullScreenScene(); + TestApplication.addKeyListeners(); + ui.processLine("OPEN"); + ui.processLine("EVBIT EV_KEY"); + ui.processLine("EVBIT EV_SYN"); + ui.processLine("KEYBIT KEY_1"); + ui.processLine("KEYBIT KEY_2"); + ui.processLine("KEYBIT KEY_3"); + ui.processLine("KEYBIT KEY_4"); + ui.processLine("KEYBIT KEY_CAPSLOCK"); + ui.processLine("PROPERTY ID_INPUT_KEYBOARD 1"); + ui.processLine("CREATE"); + + ui.processLine("EV_KEY KEY_1 1"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key pressed: DIGIT1"); + TestLog.waitForLog("Key typed: 1"); + ui.processLine("EV_KEY KEY_2 1"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key pressed: DIGIT2"); + TestLog.waitForLog("Key typed: 2"); + ui.processLine("EV_KEY KEY_1 0"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key released: DIGIT1"); + ui.processLine("EV_KEY KEY_3 1"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key pressed: DIGIT3"); + TestLog.waitForLog("Key typed: 3"); + ui.processLine("EV_KEY KEY_2 0"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key released: DIGIT2"); + ui.processLine("EV_KEY KEY_4 1"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key pressed: DIGIT4"); + TestLog.waitForLog("Key typed: 4"); + ui.processLine("EV_KEY KEY_3 0"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key released: DIGIT3"); + ui.processLine("EV_KEY KEY_4 0"); + ui.processLine("EV_SYN"); + TestLog.waitForLog("Key released: DIGIT3"); + } + }