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

            Bug ID: 462768
           Summary: Krita's canvas shortcuts system picks up spurious
                    inputs from completely unrelated windows and treats
                    them as held down modifier keys
    Classification: Applications
           Product: krita
           Version: 5.1.3
          Platform: Microsoft Windows
                OS: Microsoft Windows
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Shortcuts and Canvas Input Settings
          Assignee: krita-bugs-n...@kde.org
          Reporter: j...@nwcs.com
  Target Milestone: ---

SUMMARY
While working on an image in Krita, if I switch to an unrelated application
window, input something in it, and then come back, Krita's canvas will act as
though one or two (or sometimes even three) keyboard keys are being held down
as shortcut modifiers, thus preventing any other canvas shortcuts that don't
use that modifier from working.

Here's an example of what I see in the tablet event log, which shows my
keyboard and mouse inputs (I don't use - or own - a drawing tablet). Comments
are in double parentheses.


((Start up Krita and turn on the tablet log))
vvvvvvvvvvvvvvvvvvvvvvv START TABLET EVENT LOG vvvvvvvvvvvvvvvvvvvvvvv
((Open an image))
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
((Canvas appears. My mouse pointer is not over the canvas.))
"[       ] Enter            "
"[       ] FocusIn          "
"[       ] FocusOut         "
"[       ] Enter            "
"[       ] FocusIn          "
((I hit the 6 and 4 keys respectively to rotate the canvas right and left to
show that yes, canvas shortcuts are being received and work.))
"[       ] ShortcutOverride key: 0x36 mod: 0x0 text: 6 autorepeat: 0"
"[       ] KeyRelease       key: 0x36 mod: 0x0 text: 6 autorepeat: 0"
"[       ] ShortcutOverride key: 0x34 mod: 0x0 text: 4 autorepeat: 0"
"[       ] KeyRelease       key: 0x34 mod: 0x0 text: 4 autorepeat: 0"
((I then change to a different window (in this case, gvim)))
"[       ] FocusOut         "
((While in that new gvim window, I type the following: "ithe quick brown fox
jumped over the lazy dog<esc>". Then I switch back to Krita by clicking on the
window, and get this.))
"[       ] Enter            "
"[       ] FocusIn          "
"[       ] ShortcutOverride key: 0x45 mod: 0x0 text: none autorepeat: 0"
"[       ] FocusOut         "
"[       ] Enter            "
((Note the ShortcutOverride key entry, claiming that key 0x45 ("e") is
currently pressed. I have not pressed this key.))
((I try to hit the 6 and 4 keys again to see if they have any effect. Not only
do they have no effect, nothing appears in the log.))
((I then move my mouse pointer into and out of the canvas area, and try using
the mousewheel to see if it will zoom in and out like it should. It does not.))
"[       ] MouseMove        btn: 0 btns: 0 pos:    7,1044 gpos:  327,1174
hires:      327,    1174 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   17,1048 gpos:  337,1178
hires:      337,    1178 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   24,1050 gpos:  344,1180
hires:      344,    1180 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   32,1053 gpos:  352,1183
hires:      352,    1183 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   39,1055 gpos:  359,1185
hires:      359,    1185 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   47,1056 gpos:  367,1186
hires:      367,    1186 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   54,1059 gpos:  374,1189
hires:      374,    1189 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   62,1060 gpos:  382,1190
hires:      382,    1190 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   69,1061 gpos:  389,1191
hires:      389,    1191 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   74,1063 gpos:  394,1193
hires:      394,    1193 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   81,1064 gpos:  401,1194
hires:      401,    1194 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   87,1064 gpos:  407,1194
hires:      407,    1194 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   93,1064 gpos:  413,1194
hires:      413,    1194 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:   99,1064 gpos:  419,1194
hires:      419,    1194 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  106,1064 gpos:  426,1194
hires:      426,    1194 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  112,1065 gpos:  432,1195
hires:      432,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  117,1065 gpos:  437,1195
hires:      437,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  123,1065 gpos:  443,1195
hires:      443,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  129,1065 gpos:  449,1195
hires:      449,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  136,1065 gpos:  456,1195
hires:      456,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  141,1065 gpos:  461,1195
hires:      461,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  147,1065 gpos:  467,1195
hires:      467,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  152,1065 gpos:  472,1195
hires:      472,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  157,1065 gpos:  477,1195
hires:      477,    1195 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  162,1063 gpos:  482,1193
hires:      482,    1193 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  164,1063 gpos:  484,1193
hires:      484,    1193 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  167,1063 gpos:  487,1193
hires:      487,    1193 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  168,1063 gpos:  488,1193
hires:      488,    1193 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  169,1063 gpos:  489,1193
hires:      489,    1193 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  171,1062 gpos:  491,1192
hires:      491,    1192 Source:0"
"[       ] Enter            "
"[       ] FocusIn          "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 1 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 1 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 4 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 18 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 12 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 30 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 30 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 30 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 34 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 34 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 49 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 151 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 49 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 49 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 58 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 58 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 58 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 53 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 49 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 34 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: 4 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: -9 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: -4 orientation: V "
"[       ] Wheel            btn: - btns: 0 pos:  171,1062 gpos:  491,1192
delta: -1 orientation: V "
((Having earlier identified the "e" key as the one it thinks is pressed (due to
the ShortcutOverride log entry identified above), I hit that key. Nothing
appears in the log.))
((I then try the 4 and 6 keys again, and this time they work, with the
following log entries.))
"[       ] ShortcutOverride key: 0x34 mod: 0x0 text: 4 autorepeat: 0"
"[       ] KeyRelease       key: 0x34 mod: 0x0 text: 4 autorepeat: 0"
"[       ] ShortcutOverride key: 0x36 mod: 0x0 text: 6 autorepeat: 0"
"[       ] KeyRelease       key: 0x36 mod: 0x0 text: 6 autorepeat: 0"


STEPS TO REPRODUCE
1. Start Krita (and optionally turn on Tablet Event Logging) and open an image.
2. Switch to a non-Krita window and input something into it.
3. Switch back to Krita and attempt to use any canvas shortcuts.

OBSERVED RESULT
Canvas shortcuts fail to work. If Tablet Event Logging is on, one or more
spurious ShortcutOverride key entries will appear, corresponding to some of the
keys that were used to input into the non-Krita window.

EXPECTED RESULT
Canvas shortcuts consistently work without picking up phantom ShortcutOverride
key events from other windows (or however the heck it's finding them).


SOFTWARE/OS VERSIONS
Windows 11
I have reproduced this with Krita 5.0.6, Krita 5.1.1, and Krita 5.1.3, with
both upgrades and clean reinstalls.

ADDITIONAL INFORMATION
* I have observed this "stuck keys" phenomenon seemingly persist between
application restarts. (Either that or it's picking up phantom events as part of
the startup process as well. I have been unable to ascertain which.)
* This does not appear to be dependent on if any given part of the Krita window
is hovered over with the mouse pointer while working in the other window.
(Indeed, I have no idea what got it started).
* This ONLY applies to canvas shortcuts as defined in the Canvas Input Settings
portion of the Krita preferences window; other shortcuts (such as tool
selection shortcuts and menu shortcuts) continue to work just fine.

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

Reply via email to