Changeset View
Changeset View
Standalone View
Standalone View
xkb.h
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 46 | public: | |||
---|---|---|---|---|---|
88 | 88 | | |||
89 | quint32 currentLayout() const { | 89 | quint32 currentLayout() const { | ||
90 | return m_currentLayout; | 90 | return m_currentLayout; | ||
91 | } | 91 | } | ||
92 | QString layoutName() const; | 92 | QString layoutName() const; | ||
93 | QMap<xkb_layout_index_t, QString> layoutNames() const; | 93 | QMap<xkb_layout_index_t, QString> layoutNames() const; | ||
94 | quint32 numberOfLayouts() const; | 94 | quint32 numberOfLayouts() const; | ||
95 | 95 | | |||
96 | /** | ||||
97 | * Forwards the current modifier state to the Wayland seat | ||||
98 | **/ | ||||
99 | void forwardModifiers(); | ||||
100 | | ||||
96 | private: | 101 | private: | ||
97 | xkb_keymap *loadKeymapFromConfig(); | 102 | xkb_keymap *loadKeymapFromConfig(); | ||
98 | xkb_keymap *loadDefaultKeymap(); | 103 | xkb_keymap *loadDefaultKeymap(); | ||
99 | void updateKeymap(xkb_keymap *keymap); | 104 | void updateKeymap(xkb_keymap *keymap); | ||
100 | void createKeymapFile(); | 105 | void createKeymapFile(); | ||
101 | void updateModifiers(); | 106 | void updateModifiers(); | ||
102 | void updateConsumedModifiers(uint32_t key); | 107 | void updateConsumedModifiers(uint32_t key); | ||
103 | QString layoutName(xkb_layout_index_t layout) const; | 108 | QString layoutName(xkb_layout_index_t layout) const; | ||
Show All 15 Lines | |||||
119 | quint32 m_currentLayout = 0; | 124 | quint32 m_currentLayout = 0; | ||
120 | 125 | | |||
121 | struct { | 126 | struct { | ||
122 | xkb_compose_table *table = nullptr; | 127 | xkb_compose_table *table = nullptr; | ||
123 | xkb_compose_state *state = nullptr; | 128 | xkb_compose_state *state = nullptr; | ||
124 | } m_compose; | 129 | } m_compose; | ||
125 | LEDs m_leds; | 130 | LEDs m_leds; | ||
126 | KSharedConfigPtr m_config; | 131 | KSharedConfigPtr m_config; | ||
132 | | ||||
133 | struct { | ||||
134 | xkb_mod_index_t depressed = 0; | ||||
135 | xkb_mod_index_t latched = 0; | ||||
136 | xkb_mod_index_t locked = 0; | ||||
137 | } m_modifierState; | ||||
127 | }; | 138 | }; | ||
128 | 139 | | |||
129 | inline | 140 | inline | ||
130 | Qt::KeyboardModifiers Xkb::modifiers() const | 141 | Qt::KeyboardModifiers Xkb::modifiers() const | ||
131 | { | 142 | { | ||
132 | return m_modifiers; | 143 | return m_modifiers; | ||
133 | } | 144 | } | ||
134 | 145 | | |||
135 | } | 146 | } | ||
136 | 147 | | |||
137 | Q_DECLARE_METATYPE(KWin::Xkb::LED) | 148 | Q_DECLARE_METATYPE(KWin::Xkb::LED) | ||
138 | Q_DECLARE_METATYPE(KWin::Xkb::LEDs) | 149 | Q_DECLARE_METATYPE(KWin::Xkb::LEDs) | ||
139 | 150 | | |||
140 | #endif | 151 | #endif |