Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.12, 5.15.7
-
None
Description
Steps to reproduce:
0) Select en_US keyboard
1) Press and hold Shift key
2) Press and hold key '2' (which is for '@' symbol)
3) Release Shift key
4) Release key '2'
In the result of this sequence the application gets a really weird sequnece of events:
1) QEvent::KeyPress -> Qt::Key_Shift
2) QEvent::KeyPress -> Qt::Key_At
3) QEvent::KeyRelease -> Qt::Key_Shift
4) QEvent::KeyRelease -> Qt::Key_2 # this key has never been pressed before!
The problem happens because key's scancode is converted into qt-key using the modifiers at the moment of the event generation, which makes the qt-key code for key '2' generated incorrectly.
I've made two patches for Krita's version of Qt (5.12.12) that fix this issue (Windows and Linux platforms only), though I'm not sure, perhaps it can be fixed in a more general way.
Linux: https://invent.kde.org/graphics/krita/-/commit/d518783ca601fdc7f4d934cee01067137cc8f08e
Windows: https://invent.kde.org/graphics/krita/-/commit/d682f0f5b17f64494a718652cb4ea733f725d83c
PS:
I don't have a patch for macOS yet, though the issue is reproducible there.