Debian Codegraph @

kysdk-waylandhelper/src/kysdk-ukuiwindowhelper/ukuikeystate.h

raw symbols SCIP
1 #pragma once
2
3 #include <cstdint>
4 #include <functional>
5
6 class UkuiKeyState;
7 class UkuiKeyStatePrivate;
8
9 UkuiKeyState *ukuiKeyState();
10
11 class UkuiKeyState
12 {
13 public:
14 enum Key {
15 CapsLock = 0,
16 NumLock = 1,
17 ScrollLock = 2,
18 Alt = 3,
19 Control = 4,
20 Shift = 5,
21 Meta = 6,
22 AltGr = 7,
23 };
24
25 enum State {
26 Unlocked = 0,
27 Latched = 1,
28 Locked = 2,
29 Pressed = 3,
30 };
31
32 ~UkuiKeyState();
33
34 /*
35 * @brief fetch the current state of all keys
36 */
37 void fetchStates();
38
39 /*
40 * @brief handler for key state changed
41 * @param1 The key that changed state
42 * @param2 The new state of the key
43 */
44 std::function<void(Key /* key */, State /* key */)> &on_state_changed();
45
46 private:
47 UkuiKeyStatePrivate *m_ukuiKeyStatePrivate = nullptr;
48
49 explicit UkuiKeyState();
50 friend UkuiKeyState *ukuiKeyState();
51 };