@@ -23,7 +23,10 @@ InputMethodKeyboardGrab::~InputMethodKeyboardGrab() {
2323 // Release forward the pressed keys to the text input
2424 for (xkb_keycode_t key = 0 ; key < this ->mKeyState .size (); ++key) {
2525 if (this ->mKeyState [key] == KeyState::PRESSED) {
26- this ->mVirturalKeyboard ->sendKey (key + this ->mKeyMapState .minKeycode (), WL_KEYBOARD_KEY_STATE_PRESSED);
26+ this ->mVirturalKeyboard ->sendKey (
27+ key + this ->mKeyMapState .minKeycode (),
28+ WL_KEYBOARD_KEY_STATE_PRESSED
29+ );
2730 }
2831 }
2932}
@@ -44,12 +47,19 @@ void InputMethodKeyboardGrab::zwp_input_method_keyboard_grab_v2_keymap(
4447 munmap (mapShm, size);
4548 close (fd);
4649
47- this ->mVirturalKeyboard = VirtualKeyboardManager::instance ()->createVirtualKeyboard (this ->mKeyMapState );
48- this ->mKeyState = std::vector<KeyState>(this ->mKeyMapState .maxKeycode () - this ->mKeyMapState .minKeycode () - 8 , KeyState::RELEASED);
50+ this ->mVirturalKeyboard =
51+ VirtualKeyboardManager::instance ()->createVirtualKeyboard (this ->mKeyMapState );
52+ this ->mKeyState = std::vector<KeyState>(
53+ this ->mKeyMapState .maxKeycode () - this ->mKeyMapState .minKeycode () - 8 ,
54+ KeyState::RELEASED
55+ );
4956
5057 // Tell the text input to release all the keys
5158 for (xkb_keycode_t key = 0 ; key < this ->mKeyState .size (); ++key) {
52- this ->mVirturalKeyboard ->sendKey (key + this ->mKeyMapState .minKeycode (), WL_KEYBOARD_KEY_STATE_RELEASED);
59+ this ->mVirturalKeyboard ->sendKey (
60+ key + this ->mKeyMapState .minKeycode (),
61+ WL_KEYBOARD_KEY_STATE_RELEASED
62+ );
5363 }
5464}
5565
@@ -65,14 +75,16 @@ void InputMethodKeyboardGrab::zwp_input_method_keyboard_grab_v2_key(
6575 key += 8 ;
6676
6777 qInfo () << KeyMapState::keyStateName (static_cast <wl_keyboard_key_state>(state))
68- << this ->mKeyMapState .keyName (key) << " [" << key << " ]"
69- << this ->mKeyMapState .getChar (key);
78+ << this ->mKeyMapState .keyName (key) << " [" << key << " ]"
79+ << this ->mKeyMapState .getChar (key);
7080
71- if (state == WL_KEYBOARD_KEY_STATE_PRESSED
81+ if (
82+ state == WL_KEYBOARD_KEY_STATE_PRESSED
7283#ifndef WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION
73- || state == WL_KEYBOARD_KEY_STATE_REPEATED
84+ || state == WL_KEYBOARD_KEY_STATE_REPEATED
7485#endif
75- ) {
86+ )
87+ {
7688 this ->mKeyState [key - this ->mKeyMapState .minKeycode ()] = KeyState::PRESSED;
7789 } else if (state == WL_KEYBOARD_KEY_STATE_RELEASED) {
7890 this ->mKeyState [key - this ->mKeyMapState .minKeycode ()] = KeyState::RELEASED;
0 commit comments