Changeset View
Changeset View
Standalone View
Standalone View
keyboard_input.h
Show All 37 Lines | |||||
38 | typedef uint32_t xkb_mod_index_t; | 38 | typedef uint32_t xkb_mod_index_t; | ||
39 | typedef uint32_t xkb_led_index_t; | 39 | typedef uint32_t xkb_led_index_t; | ||
40 | typedef uint32_t xkb_keysym_t; | 40 | typedef uint32_t xkb_keysym_t; | ||
41 | 41 | | |||
42 | namespace KWin | 42 | namespace KWin | ||
43 | { | 43 | { | ||
44 | 44 | | |||
45 | class InputRedirection; | 45 | class InputRedirection; | ||
46 | class KeyboardLayout; | ||||
46 | class ModifiersChangedSpy; | 47 | class ModifiersChangedSpy; | ||
47 | class Toplevel; | 48 | class Toplevel; | ||
48 | 49 | | |||
49 | namespace LibInput | 50 | namespace LibInput | ||
50 | { | 51 | { | ||
51 | class Device; | 52 | class Device; | ||
52 | } | 53 | } | ||
53 | 54 | | |||
Show All 35 Lines | 57 | public: | |||
89 | 90 | | |||
90 | xkb_state *state() const { | 91 | xkb_state *state() const { | ||
91 | return m_state; | 92 | return m_state; | ||
92 | } | 93 | } | ||
93 | 94 | | |||
94 | quint32 currentLayout() const { | 95 | quint32 currentLayout() const { | ||
95 | return m_currentLayout; | 96 | return m_currentLayout; | ||
96 | } | 97 | } | ||
98 | QString layoutName() const; | ||||
97 | 99 | | |||
98 | private: | 100 | private: | ||
99 | xkb_keymap *loadKeymapFromConfig(); | 101 | xkb_keymap *loadKeymapFromConfig(); | ||
100 | xkb_keymap *loadDefaultKeymap(); | 102 | xkb_keymap *loadDefaultKeymap(); | ||
101 | void updateKeymap(xkb_keymap *keymap); | 103 | void updateKeymap(xkb_keymap *keymap); | ||
102 | void createKeymapFile(); | 104 | void createKeymapFile(); | ||
103 | void updateModifiers(); | 105 | void updateModifiers(); | ||
104 | void updateConsumedModifiers(uint32_t key); | 106 | void updateConsumedModifiers(uint32_t key); | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 138 | public: | |||
162 | } | 164 | } | ||
163 | Qt::KeyboardModifiers modifiersRelevantForGlobalShortcuts() const { | 165 | Qt::KeyboardModifiers modifiersRelevantForGlobalShortcuts() const { | ||
164 | return m_xkb->modifiersRelevantForGlobalShortcuts(); | 166 | return m_xkb->modifiersRelevantForGlobalShortcuts(); | ||
165 | } | 167 | } | ||
166 | 168 | | |||
167 | Q_SIGNALS: | 169 | Q_SIGNALS: | ||
168 | void ledsChanged(KWin::Xkb::LEDs); | 170 | void ledsChanged(KWin::Xkb::LEDs); | ||
169 | 171 | | |||
170 | private Q_SLOTS: | | |||
171 | void reconfigure(); | | |||
172 | | ||||
173 | private: | 172 | private: | ||
174 | InputRedirection *m_input; | 173 | InputRedirection *m_input; | ||
175 | bool m_inited = false; | 174 | bool m_inited = false; | ||
176 | QScopedPointer<Xkb> m_xkb; | 175 | QScopedPointer<Xkb> m_xkb; | ||
177 | QMetaObject::Connection m_activeClientSurfaceChangedConnection; | 176 | QMetaObject::Connection m_activeClientSurfaceChangedConnection; | ||
178 | struct { | 177 | struct { | ||
179 | quint32 key = 0; | 178 | quint32 key = 0; | ||
180 | quint32 time = 0; | 179 | quint32 time = 0; | ||
181 | QTimer *timer = nullptr; | 180 | QTimer *timer = nullptr; | ||
182 | } m_keyRepeat; | 181 | } m_keyRepeat; | ||
183 | ModifiersChangedSpy *m_modifiersChangedSpy = nullptr; | 182 | ModifiersChangedSpy *m_modifiersChangedSpy = nullptr; | ||
183 | KeyboardLayout *m_keyboardLayout = nullptr; | ||||
184 | }; | 184 | }; | ||
185 | 185 | | |||
186 | inline | 186 | inline | ||
187 | Qt::KeyboardModifiers Xkb::modifiers() const | 187 | Qt::KeyboardModifiers Xkb::modifiers() const | ||
188 | { | 188 | { | ||
189 | return m_modifiers; | 189 | return m_modifiers; | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | } | 192 | } | ||
193 | 193 | | |||
194 | Q_DECLARE_METATYPE(KWin::Xkb::LED) | 194 | Q_DECLARE_METATYPE(KWin::Xkb::LED) | ||
195 | Q_DECLARE_METATYPE(KWin::Xkb::LEDs) | 195 | Q_DECLARE_METATYPE(KWin::Xkb::LEDs) | ||
196 | 196 | | |||
197 | #endif | 197 | #endif |