|
| void | keyboard_enter (uint32_t serial, wl_surface *surface, wl_array *keys) override |
| |
| void | keyboard_key (uint32_t serial, uint32_t time, uint32_t key, uint32_t state) override |
| |
| void | keyboard_keymap (uint32_t format, int32_t fd, uint32_t size) override |
| |
| void | keyboard_leave (uint32_t serial, wl_surface *surface) override |
| |
| void | keyboard_modifiers (uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) override |
| |
◆ Keyboard()
| KisWaylandKeyboardWatcher::Keyboard::Keyboard |
( |
::wl_keyboard * | keyboard | ) |
|
|
inline |
◆ ~Keyboard()
| KisWaylandKeyboardWatcher::Keyboard::~Keyboard |
( |
| ) |
|
|
inline |
◆ hasKeyboardFocus()
| bool KisWaylandKeyboardWatcher::Keyboard::hasKeyboardFocus |
( |
| ) |
const |
|
inline |
◆ keyboard_enter()
| void KisWaylandKeyboardWatcher::Keyboard::keyboard_enter |
( |
uint32_t | serial, |
|
|
wl_surface * | surface, |
|
|
wl_array * | keys ) |
|
inlineoverrideprivate |
Definition at line 159 of file KisWaylandKeyboardWatcher.cpp.
160 {
162 mNativeKeys.reserve(keys->size /
sizeof(uint32_t));
163
164 for (const uint32_t *keyPtr = static_cast<const uint32_t *>(keys->data);
165 reinterpret_cast<const char *>(keyPtr) < static_cast<const char *>(keys->data) + keys->size;
166 keyPtr++) {
168 }
169
171 }
QList< uint32_t > mNativeKeys
References m_focus, and mNativeKeys.
◆ keyboard_key()
| void KisWaylandKeyboardWatcher::Keyboard::keyboard_key |
( |
uint32_t | serial, |
|
|
uint32_t | time, |
|
|
uint32_t | key, |
|
|
uint32_t | state ) |
|
inlineoverrideprivate |
Definition at line 133 of file KisWaylandKeyboardWatcher.cpp.
134 {
135 const bool isDown = state != WL_KEYBOARD_KEY_STATE_RELEASED;
136 if (isDown) {
139 qWarning().nospace() << "WARNING: got a key-down for a key (" << Qt::hex << Qt::showbase << key << ") which is reported to be pressed already!";
140 } else {
142 }
143 } else {
146 qWarning().nospace() << "WARNING: got a key-up for a key (" << Qt::hex << Qt::showbase << key << ") which is NOT reported to be pressed!";
147 } else {
149 }
150 }
151 }
References mNativeKeys.
◆ keyboard_keymap()
| void KisWaylandKeyboardWatcher::Keyboard::keyboard_keymap |
( |
uint32_t | format, |
|
|
int32_t | fd, |
|
|
uint32_t | size ) |
|
inlineoverrideprivate |
Definition at line 102 of file KisWaylandKeyboardWatcher.cpp.
103 {
105
106 if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
107 qDebug() << "unknown keymap format:" << format;
109 return;
110 }
111
112 char *map_str = static_cast<char *>(mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0));
113 if (map_str == MAP_FAILED) {
115 return;
116 }
117
119 if (xkbContext) {
120 mXkbKeymap.reset(xkb_keymap_new_from_string(xkbContext, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS));
121 QXkbCommon::verifyHasLatinLayout(
mXkbKeymap.get());
122 }
123
124 munmap(map_str, size);
126
129 else
131 }
static struct xkb_context * getGlobalXkbContextFromQt()
QXkbCommon::ScopedXKBKeymap mXkbKeymap
QXkbCommon::ScopedXKBState mXkbState
QAction * close(const QObject *recvr, const char *slot, QObject *parent)
References getGlobalXkbContextFromQt(), mKeymapFormat, mXkbKeymap, and mXkbState.
◆ keyboard_leave()
| void KisWaylandKeyboardWatcher::Keyboard::keyboard_leave |
( |
uint32_t | serial, |
|
|
wl_surface * | surface ) |
|
inlineoverrideprivate |
◆ keyboard_modifiers()
| void KisWaylandKeyboardWatcher::Keyboard::keyboard_modifiers |
( |
uint32_t | serial, |
|
|
uint32_t | mods_depressed, |
|
|
uint32_t | mods_latched, |
|
|
uint32_t | mods_locked, |
|
|
uint32_t | group ) |
|
inlineoverrideprivate |
◆ modifiers()
| Qt::KeyboardModifiers KisWaylandKeyboardWatcher::Keyboard::modifiers |
( |
| ) |
const |
|
inline |
◆ pressedKeys()
| QList< Qt::Key > KisWaylandKeyboardWatcher::Keyboard::pressedKeys |
( |
| ) |
const |
|
inline |
Definition at line 66 of file KisWaylandKeyboardWatcher.cpp.
67 {
69
72 auto code = key + 8;
73
74 xkb_keysym_t sym = xkb_state_key_get_one_sym(
mXkbState.get(), code);
76
77 Qt::Key qtKey =
static_cast<Qt::Key
>(QXkbCommon::keysymToQtKey(sym,
modifiers,
mXkbState.get(), code));
78
79 if (qtKey != Qt::Key_unknown)
80 keys.append(qtKey);
81 }
82 }
83
84 return keys;
85 }
Qt::KeyboardModifiers modifiers() const
References mNativeKeys, modifiers(), and mXkbState.
◆ m_focus
| bool KisWaylandKeyboardWatcher::Keyboard::m_focus = false |
|
private |
◆ mKeymapFormat
| uint32_t KisWaylandKeyboardWatcher::Keyboard::mKeymapFormat = WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 |
|
private |
◆ mNativeKeys
| QList<uint32_t> KisWaylandKeyboardWatcher::Keyboard::mNativeKeys |
|
private |
◆ mNativeModifiers
| uint32_t KisWaylandKeyboardWatcher::Keyboard::mNativeModifiers = 0 |
|
private |
◆ mXkbKeymap
| QXkbCommon::ScopedXKBKeymap KisWaylandKeyboardWatcher::Keyboard::mXkbKeymap |
|
private |
◆ mXkbState
| QXkbCommon::ScopedXKBState KisWaylandKeyboardWatcher::Keyboard::mXkbState |
|
private |
The documentation for this class was generated from the following file: