@@ -134,40 +134,31 @@ Item {
134 compare(screenshotSpy.count, 1);
134 compare(screenshotSpy.count, 1);
137− function test_altIsDispatchedOnRelease() {
137+ function test_altIsCancelledOnAltTab() {
138− // Press alt, make sure it does *not* end up in inputCatcher (aka, the focused app)
138+ // Press alt, make sure it does end up in inputCatcher (aka, the focused app)
139+ inputCatcher.pressedKeys = [];
139 keyPress(Qt.Key_Alt, Qt.NoModifier)
140 keyPress(Qt.Key_Alt, Qt.NoModifier)
140− compare(inputCatcher.pressedKeys.length, 0);
141− // Now release alt. It should cause the previous Alt press to be dispatched along with the release
142− keyRelease(Qt.Key_Alt, Qt.NoModifier);
143 compare(inputCatcher.pressedKeys.length, 1);
141 compare(inputCatcher.pressedKeys.length, 1);
144 compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);
142 compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);
143+ // Now also press tab. As this should trigger the spread, alt needs to be released for the app
144+ keyPress(Qt.Key_Tab, Qt.NoModifier)
145 compare(inputCatcher.releasedKeys.length, 1);
145 compare(inputCatcher.releasedKeys.length, 1);
146 compare(inputCatcher.releasedKeys[0], Qt.Key_Alt);
146 compare(inputCatcher.releasedKeys[0], Qt.Key_Alt);
149− function test_altIsNotDispatchedOnAltTab() {
150− // Press alt, make sure it does *not* end up in inputCatcher (aka, the focused app)
151− inputCatcher.pressedKeys = [];
152− keyPress(Qt.Key_Alt, Qt.NoModifier)
153− compare(inputCatcher.pressedKeys.length, 0);
154− // Now also press tab. As this should trigger the spread, neither of them should end up in the app
155− keyPress(Qt.Key_Tab, Qt.NoModifier)
156− compare(inputCatcher.pressedKeys.length, 0);
158− // Also the release events should not be dispatched to the app
148+ // Now release the keys, none of that should get to the app any more
159 keyRelease(Qt.Key_Tab, Qt.NoModifier);
149 keyRelease(Qt.Key_Tab, Qt.NoModifier);
160 keyRelease(Qt.Key_Alt, Qt.NoModifier);
150 keyRelease(Qt.Key_Alt, Qt.NoModifier);
161− compare(inputCatcher.pressedKeys.length, 0);
151+ compare(inputCatcher.pressedKeys.length, 1);
162− compare(inputCatcher.releasedKeys.length, 0);
152+ compare(inputCatcher.releasedKeys.length, 1);
165 function test_altComboIsDispatched() {
155 function test_altComboIsDispatched() {
166 inputCatcher.pressedKeys = [];
156 inputCatcher.pressedKeys = [];
167− // Press alt, make sure it does *not* yet end up in inputCatcher (aka, the focused app)
157+ // Press alt, make sure it does end up in inputCatcher (aka, the focused app)
168 keyPress(Qt.Key_Alt, Qt.NoModifier)
158 keyPress(Qt.Key_Alt, Qt.NoModifier)
169− compare(inputCatcher.pressedKeys.length, 0);
159+ compare(inputCatcher.pressedKeys.length, 1);
160+ compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);
170− // Now press F in order to opening the File menu (Alt+F), now the app should get the full combo
161+ // Now press F in order to opening the File menu (Alt+F), make sure it is dispatched too
171 keyPress(Qt.Key_F, Qt.NoModifier)
162 keyPress(Qt.Key_F, Qt.NoModifier)
172 compare(inputCatcher.pressedKeys.length, 2);
163 compare(inputCatcher.pressedKeys.length, 2);
173 compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);
164 compare(inputCatcher.pressedKeys[0], Qt.Key_Alt);