Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/globalshortcuts_test.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 76 | { | |||
---|---|---|---|---|---|
84 | KGlobalAccel::self()->setShortcut(action.data(), QList<QKeySequence>{Qt::Key_Percent}, KGlobalAccel::NoAutoloading); | 84 | KGlobalAccel::self()->setShortcut(action.data(), QList<QKeySequence>{Qt::Key_Percent}, KGlobalAccel::NoAutoloading); | ||
85 | input()->registerShortcut(Qt::Key_Percent, action.data()); | 85 | input()->registerShortcut(Qt::Key_Percent, action.data()); | ||
86 | 86 | | |||
87 | // press shift+5 | 87 | // press shift+5 | ||
88 | quint32 timestamp = 0; | 88 | quint32 timestamp = 0; | ||
89 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++); | 89 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTSHIFT, timestamp++); | ||
90 | QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier); | 90 | QCOMPARE(input()->keyboardModifiers(), Qt::ShiftModifier); | ||
91 | kwinApp()->platform()->keyboardKeyPressed(KEY_5, timestamp++); | 91 | kwinApp()->platform()->keyboardKeyPressed(KEY_5, timestamp++); | ||
92 | QEXPECT_FAIL("", "Consumed modifiers are not removed from checking", Continue); | | |||
93 | QTRY_COMPARE(triggeredSpy.count(), 1); | 92 | QTRY_COMPARE(triggeredSpy.count(), 1); | ||
94 | kwinApp()->platform()->keyboardKeyReleased(KEY_5, timestamp++); | 93 | kwinApp()->platform()->keyboardKeyReleased(KEY_5, timestamp++); | ||
95 | 94 | | |||
96 | // release shift | 95 | // release shift | ||
97 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++); | 96 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++); | ||
98 | } | 97 | } | ||
99 | 98 | | |||
100 | WAYLANDTEST_MAIN(GlobalShortcutsTest) | 99 | WAYLANDTEST_MAIN(GlobalShortcutsTest) | ||
101 | #include "globalshortcuts_test.moc" | 100 | #include "globalshortcuts_test.moc" |