Bug 430479

Summary: Keyboard shortcut to decrease brush size (left bracket) doesn't work with Spanish layout
Product: [Applications] krita Reporter: jbalague
Component: Brush Engine/ShapeAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version: 4.4.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description jbalague 2020-12-16 19:36:54 UTC
SUMMARY
Keyboard shortcut to decrease brush size (left bracket) doesn't work when Spanish layout is selected.
It works fine when an English (US or UK) layout is selected. 
Keyboard shortcut to increase brush size (right bracket) works fine in Spanish or English layouts.

Tested with Krita-x64-4.4.1, on Windows 10 Home version 2004 (64 bit). 
Tested with Krita-x64-4.2.8, on Windows 10 Home version 1909 (64 bit).

STEPS TO REPRODUCE
01. Launch Krita 4.4.1 or Krita-x64-4.2.8 on Windows 10.
02. Create a new document (File > New > Create).
03. Select the brush tool ('B' key).
04. Make sure you have the English keyboard layout (US or UK).
05. Decrease the brush size with the '[' key --> it works.
06. Increase the brush size with the ']' key --> it works.
07. Change keyboard layout to Spanish.
08. Decrease the brush size with the '[' key --> IT DOESN'T WORK!!!
09. Increase the brush size with the ']' key --> it works!!!
10. Change keyboard layout back to English.
11. Decrease the brush size with the '[' key --> it works.
 
OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: W10 home, 64 bit, version 2004.
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2020-12-17 11:07:41 UTC
I can confirm the issue. This is a windows-specific issue, it doesn't happen with X11/plasma/kwin with a spanish keyboard layout.
Comment 2 Halla Rempt 2020-12-17 11:08:59 UTC
When a spanish keyboard layout is active, altgr-[ seems to send ctrl-alt-^ -- not sure what we can do about that.
Comment 3 Dmitry Kazakov 2021-02-15 04:04:52 UTC
I have almost the same issue with the Russian keyboard layout. The Russian keyboard layout is very different and doesn't have '[' and ']' keys at all. So we usually expect the shortcuts to be mapped to the English keys and work the same way in the Russian layout. Btw, shortcuts like 'b' and 't' work in the Russian layout perfectly fine.
Comment 4 Dmitry Kazakov 2021-02-15 07:58:25 UTC
Git commit bb260d701b7a0f69447b1272d899d4b89d0415cb by Dmitry Kazakov.
Committed on 15/02/2021 at 07:58.
Pushed by dkazakov into branch 'master'.

Fix shortcuts assigned to special keys on non-latin layouts

When the user has non-latin layout we still consider latin
meaning of the keys to be a priorty. This behavior is already
in Qt (and is disputable), but this patch doesn't change that.
The patch only adds proper handling of special keys:

* '\' --- backslash/bar key
* '/' --- slash/question key
* ';' --- semicolon/colon key
* '`' --- backqoute/tilde key
* ''' --- quote/doublequote key
* '[' --- left bracket key
* ']' --- right bracket key
* ',' --- comma/< key
* '.' --- period/> key
* '-' --- minus/underscore key
* '=' --- equal/plus key

A  +75   -0    3rdparty/ext_qt/0112-Fix-shortcuts-assigned-to-special-keys-on-non-latin-.patch
A  +42   -0    3rdparty/ext_qt/0113-Fix-multiple-shortcuts-match-from-different-keyboard.patch
M  +10   -0    3rdparty/ext_qt/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/bb260d701b7a0f69447b1272d899d4b89d0415cb
Comment 5 Dmitry Kazakov 2021-02-15 08:30:07 UTC
Hi, Jbalague!

Could you please check if this package fixes the problem for you?

https://disk.yandex.ru/d/AWgV9pRWgoOA2A

Before testing, please make sure you've made a backup of files in %APPDATA% and %LOCALAPPDATA%. This package is based on Krita 5.0, so it may break the configuration of Krita 4.4.
Comment 6 Dmitry Kazakov 2021-02-17 13:20:46 UTC
Git commit cdfc724f2ea297fbd4e943d384f5be7d62162540 by Dmitry Kazakov.
Committed on 17/02/2021 at 13:20.
Pushed by dkazakov into branch 'master'.

Fix shortcuts with special keys on non-US layouts on Linux

WARNING: this patch solidifies the precedence of the us-latin layout
key positions over the current user layout. It basically means that
if the user's layout swaps the position of Z and Y letters, then Ctrl+Y
will still work as Ctrl+Z.

I need user's input on that change. Afaict, this bahavior was the default
on Windows, but it was not so on Linux before.

A  +93   -0    3rdparty/ext_qt/0114-Fix-shortcuts-with-special-keys-on-non-US-layouts-on.patch
M  +1    -0    3rdparty/ext_qt/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/cdfc724f2ea297fbd4e943d384f5be7d62162540