MCPcopy Create free account
hub / github.com/deskflow/deskflow / fakePollCharWithModifier

Method fakePollCharWithModifier

src/unittests/platform/OSXKeyStateTests.cpp:97–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void OSXKeyStateTests::fakePollCharWithModifier()
98{
99 deskflow::KeyMap keyMap;
100 EventQueue eventQueue;
101 OSXKeyState keyState(&eventQueue, keyMap, {"en"}, true);
102 keyState.updateKeyMap();
103
104 keyState.fakeKeyDown(A_CHAR_ID, KeyModifierShift, 1, "en");
105 QVERIFY(isKeyPressed(keyState, A_CHAR_BUTTON));
106
107 keyState.fakeKeyUp(1);
108 QVERIFY(!isKeyPressed(keyState, A_CHAR_BUTTON));
109
110 // HACK: delete the key in case it was typed into a text editor.
111 // we should really set focus to an invisible window.
112 keyState.fakeKeyDown(kKeyBackSpace, 0, 2, "en");
113 keyState.fakeKeyUp(2);
114}
115
116bool OSXKeyStateTests::isKeyPressed(const OSXKeyState &keyState, KeyButton button)
117{

Callers

nothing calls this directly

Calls 3

updateKeyMapMethod · 0.45
fakeKeyDownMethod · 0.45
fakeKeyUpMethod · 0.45

Tested by

no test coverage detected