You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using the imx6 backend and have a problem with modifier keys (shift, alt etc.).
If the Shift key is held down for the two key presses or longer then shift key stays in the DEPRESSED state when the key is released.
This is causing problems in the JavaScript code because then key event indicates that shift key is held down when other keys are used.
Seems to be that problem is in the input server:
LibinputServer::handleKeyboardEvent(uint32_t eventTime, uint32_t code, uint32_t state)
which is calling the
xkb_state_update_key(xkbState, code, !!state ? XKB_KEY_DOWN : XKB_KEY_UP);
From the xkbcommon documentation I can see that this function must be called with matching KEY_DOWN/KEY_UP pairs. If the key is held down then there are multiple KEY_DOW events with one KEY_UP which is causing the mods stay in the DEPRESSED state.
A series of calls to this function should be consistent; that is, a call with XKB_KEY_DOWN for a key should be matched by an XKB_KEY_UP; if a key is pressed twice, it should be released twice; etc. Otherwise (e.g. due to missed input events), situations like "stuck modifiers" may occur.
xkb_state_serialize_mods(xkbState, XKB_STATE_MODS_DEPRESSED) always returns that modifier is still down after it has been released.
Is there a fix for this or I have to implement my own solution to keep separate state of the mod keys and drop for example shift key events if key is already pressed?
The text was updated successfully, but these errors were encountered:
I have been using the imx6 backend and have a problem with modifier keys (shift, alt etc.).
If the Shift key is held down for the two key presses or longer then shift key stays in the DEPRESSED state when the key is released.
This is causing problems in the JavaScript code because then key event indicates that shift key is held down when other keys are used.
Seems to be that problem is in the input server:
LibinputServer::handleKeyboardEvent(uint32_t eventTime, uint32_t code, uint32_t state)
which is calling the
xkb_state_update_key(xkbState, code, !!state ? XKB_KEY_DOWN : XKB_KEY_UP);
From the xkbcommon documentation I can see that this function must be called with matching KEY_DOWN/KEY_UP pairs. If the key is held down then there are multiple KEY_DOW events with one KEY_UP which is causing the mods stay in the DEPRESSED state.
xkb_state_serialize_mods(xkbState, XKB_STATE_MODS_DEPRESSED) always returns that modifier is still down after it has been released.
Is there a fix for this or I have to implement my own solution to keep separate state of the mod keys and drop for example shift key events if key is already pressed?
The text was updated successfully, but these errors were encountered: