https://bugs.kde.org/show_bug.cgi?id=513897

            Bug ID: 513897
           Summary: Wayland client doesn't receive a key event after
                    switching a keyboard layout
    Classification: Plasma
           Product: kwin
      Version First unspecified
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY
After switching a keyboard layout, one of the keys used to switch layouts might
get stuck in a state such that the wayland client won't receive a "Key" event
upon releasing that key (but will receive a "Modifier" event).

STEPS TO REPRODUCE
1. Configure two or more keyboard layouts
2. Set the layout switch shortcut to Ctrl+Shift
3. run ``WAYLAND_DEBUG=client dolphin``
4. Input the following key sequence into an opened window:
  - Press CTRL
  - Press SHIFT
  - Release CTRL
  - Release SHIFT
  - Out of curiosity, press CTRL again
  - Release CTRL

OBSERVED RESULT
You will see something like this in terminal:
```
wl_keyboard#27.key(38315, 48717702, 29, 1) //CTRL pressed
wl_keyboard#27.modifiers(38317, 4, 0, 0, 1) //CTRL pressed
wl_keyboard#27.key(38318, 48719295, 42, 1) //SHIFT pressed
wl_keyboard#27.modifiers(38320, 5, 0, 0, 1) //SHIFT pressed
wl_keyboard#27.modifiers(38322, 1, 0, 0, 1) //CTRL released
wl_keyboard#27.modifiers(38323, 1, 0, 0, 0) //CTRL released
wl_keyboard#27.key(38324, 48724027, 42, 0) //SHIFT released
wl_keyboard#27.modifiers(38326, 0, 0, 0, 0) //SHIFT released
wl_keyboard#27.modifiers(38328, 4, 0, 0, 0) //CTRL pressed
wl_keyboard#27.key(38329, 48727759, 29, 0) //CTRL released
wl_keyboard#27.modifiers(38330, 0, 0, 0, 0) //CTRL released
```

EXPECTED RESULT
```
wl_keyboard#27.key(38315, 48717702, 29, 1) //CTRL pressed
wl_keyboard#27.modifiers(38317, 4, 0, 0, 1) //CTRL pressed
wl_keyboard#27.key(38318, 48719295, 42, 1) //SHIFT pressed
wl_keyboard#27.modifiers(38320, 5, 0, 0, 1) //SHIFT pressed
wl_keyboard#27.key(38329, 48727759, 29, 0) // Additional CTRL released "Key
event"
wl_keyboard#27.modifiers(38322, 1, 0, 0, 1) //CTRL released
wl_keyboard#27.modifiers(38323, 1, 0, 0, 0) //CTRL released
wl_keyboard#27.key(38324, 48724027, 42, 0) //Just like SHIFT released "Key
event" here
wl_keyboard#27.modifiers(38326, 0, 0, 0, 0) //SHIFT released
wl_keyboard#27.modifiers(38328, 4, 0, 0, 0) //CTRL pressed
wl_keyboard#27.key(38329, 48727759, 29, 0) //CTRL released
wl_keyboard#27.modifiers(38330, 0, 0, 0, 0) //CTRL released
```

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.18.2-arch2-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL IMFORMATION
This is a problem because after switching layouts, if you were to press the
"stuck key" again, the client will only receive a modifier event. This breaks
applications like video games that use modifier keys as an input source (see
glfw issue: https://github.com/glfw/glfw/issues/1011 , ultimately breaking
Minecraft)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to