Bug 468566 - Cannot enter characters with `ALT GR` modifier key while renaming layers (keys combination is captured by shortcuts)
Summary: Cannot enter characters with `ALT GR` modifier key while renaming layers (key...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Shortcuts and Canvas Input Settings (show other bugs)
Version: 5.1.4
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
: 446038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-16 11:31 UTC by Aurélien Da Campo
Modified: 2023-06-22 14:50 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurélien Da Campo 2023-04-16 11:31:13 UTC
SUMMARY
Entering special characters (3rd character alternative) through `ALT GR` modifier key while renaming a layer is not possible or complicated via copy/pasting them.

STEPS TO REPRODUCE
1. Start renaming a layer
2. Try to type a special character using ALT GR modifier key

OBSERVED RESULT
The keyboard combination is captured by a shortcut and therefore no characters are added to the text field.

EXPECTED RESULT
All Krita specific shortcuts should be disabled while entering text.

WORKAROUND
Copy the character from an outside text editor and paste it in Krita

ADDITIONAL INFORMATION
I have a Swiss French keyboard layout (QWERTZ), the characters I cannot directly enter are: ¦@#°§¬|¢´~[]{}\
Comment 1 Halla Rempt 2023-05-10 13:08:14 UTC
Hi!

Can you add those characters

* when the layerbox is undocked?
* the search field in the brush presets docker?
Comment 2 Aurélien Da Campo 2023-05-10 13:32:17 UTC
(In reply to Halla Rempt from comment #1)
> Hi!
> 
> Can you add those characters
> 
> * when the layerbox is undocked?
> * the search field in the brush presets docker?

Hi,

Thanks for taking the time to investigate this issue :) 

Here are few answers to your questions:
1) The behavior is the same when the layer box is docked or undocked
2) The behavior is the same when in the brush presets search box

I noticed something new, I can enter few of the characters on Vector Layers. This really seems to be linked to the capture of shortcuts by the current context. When being in the context of a Paint Layer, the character input is captured by the shortcuts of the painting tool. For example, if I try to enter the character `[` with the shortcut `ALTGR` + `[` I see callout showing that the Brush Size has been reduced but no characters are entered in the input field.
Comment 3 Halla Rempt 2023-05-10 14:14:31 UTC
That's interesting, and makes it more probable that this is a bug we can fix, instead of a misfeature in Qt.
Comment 4 Halla Rempt 2023-05-11 07:03:57 UTC
I've added this issue to the bugs to discuss in next Monday's team meeting: https://docs.google.com/document/d/1JOZly_nL-oAORpwbEx3wdyuhomz-I2CGZT67RztosPA/edit#
Comment 5 Dmitry Kazakov 2023-05-11 08:34:51 UTC
Well, yes, we have some special code that maps AltGr to something else on Windows to make sure it works as a shortcut... We need to look into that, especially, why KisInputManager interferes with the input boxes.
Comment 6 Dmitry Kazakov 2023-05-22 15:44:46 UTC
Hi, Aurélien!

Could you please test this package? 

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

I have tested these testcases and they work fine with the following testcases:

1) Rename a layer
2) Add/Edit a layers filter (in a popup)
3) Add/Edit  a brush preset filter
4) Add new brush preset tag (in a popup)

I have tested that in US-Intl-AltGr layout. Could you test that with French layout?
Comment 7 grum999 2023-05-23 11:32:54 UTC
Hi 

Can't test it for now, but could the problem of bug https://bugs.kde.org/show_bug.cgi?id=469691 is related with this one?

Grum999
Comment 8 Bug Janitor Service 2023-05-23 18:37:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1807
Comment 9 Halla Rempt 2023-05-29 14:05:08 UTC
Aurélien, could you please test Dmitry's package?
Comment 10 Aurélien Da Campo 2023-06-01 07:01:22 UTC
I just tested the provided build (5.2.0-prealpha (git a92c1c6)) and the issue is still present with the same symptoms.
Comment 11 Dmitry Kazakov 2023-06-02 13:57:06 UTC
Hi, Aurélien!

Could you please make a video recording of the screen with the problem? I have installed French layout into my system and I could type [] and {} perfectly fine with AltGr on my system...
Comment 12 Aurélien Da Campo 2023-06-02 15:03:05 UTC
Hi Dmitry! 

Here is the shot - I even managed to reproduce it with the Windows On-Screen Keyboard: 
https://www.swisstransfer.com/d/1cb99891-2ca7-4d59-a8d7-1b979c050635
Comment 13 Dmitry Kazakov 2023-06-02 15:27:40 UTC
Thank you! I will recheck a bit later today
Comment 14 Dmitry Kazakov 2023-06-21 16:11:31 UTC
Git commit 45a9469f0f2d0fc8f654247a5593032fa600a0d5 by Dmitry Kazakov.
Committed on 21/06/2023 at 16:11.
Pushed by dkazakov into branch 'master'.

Fix typing symbols with AltGr key on Windows

We need to pass an environment variable to Qt to make sure Qt
detects AltGr key as Qt::GroupSwitchModifier

M  +4    -0    krita/main.cc

https://invent.kde.org/graphics/krita/-/commit/45a9469f0f2d0fc8f654247a5593032fa600a0d5
Comment 15 Dmitry Kazakov 2023-06-22 10:17:44 UTC
Git commit d09b21a09b6d722fe5be6e1a235f7085dbfdca7a by Dmitry Kazakov.
Committed on 22/06/2023 at 09:56.
Pushed by dkazakov into branch 'master'.

Fix Layer Filter and Add Tag menues from being closed when AltGr is pressed

QMenu has a spcial handler for Alt key to handle &-style mnemonics,
so we need to explicitly disable that for our custom menues that
have input boxes inside.

M  +5    -1    libs/resourcewidgets/KisTagToolButton.cpp
M  +1    -0    libs/widgetutils/CMakeLists.txt
A  +20   -0    libs/widgetutils/KisMenuStyleDontCloseOnAlt.cpp     [License: GPL(v2.0+)]
A  +26   -0    libs/widgetutils/KisMenuStyleDontCloseOnAlt.h     [License: GPL(v2.0+)]
M  +6    -1    plugins/dockers/layerdocker/LayerBox.cpp

https://invent.kde.org/graphics/krita/-/commit/d09b21a09b6d722fe5be6e1a235f7085dbfdca7a
Comment 16 Dmitry Kazakov 2023-06-22 14:50:46 UTC
*** Bug 446038 has been marked as a duplicate of this bug. ***