Bug 462919 - [Android] Physical Keyboard input is broken under Android
Summary: [Android] Physical Keyboard input is broken under Android
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Shortcuts and Canvas Input Settings (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Android Android 13.x
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-11 17:22 UTC by Tyson Tan
Modified: 2024-11-21 13:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Invalid recoring of key combination when a modifier is pressed (272.33 KB, image/png)
2022-12-16 13:38 UTC, Tyson Tan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2022-12-11 17:22:51 UTC
On some (and maybe all) Android systems, Krita's input conflicts with the system-wide input method.

An "Input Method" is what users use to input non-English letters, like Chinese and Japanese. When an input method is switched ON, it intercepts keyboard inputs and translates the input letters into target language letters. 

An input method should be available only when a text input field is in focus. It should be automatically switched OFF when the focus is removed from the text input field. A system-wide shortcut: SHIFT, is often used to change between languages when Input Methods are available.

However, in Krita's case, the app behaves as if it is always in text input mode. And therefore, Input Methods are always available. This quirk has many unfortunate consequences that make keyboard shortcut useless for non-English users.

For example, my device's default language is Chinese. In text input mode, its default language is Chinese. In such state, Krita is unable to interpret shortcut key presses. To use keyboard shortcuts, I must press SHIFT repeatedly until the language is English. And if I pressed SHIFT after that, it will break Krita's shortcuts, again.

This issue never happened under Windows or Linux.

Tested on:
Samsung Galaxy Tab S8 with One UI 5.0 (Android 13).
Krita 5.1.2 and latest Krita Next nightlies (5.2.0).
Comment 1 Tyson Tan 2022-12-12 02:58:19 UTC
I have investigated deeper into this issue. It seems many physical keyboard related things have broken under Android. They are probably all input method related, and they affect English users too.

1) English inputs are always uppercased. It was likely to be caused by Android's English input method's Auto-Uppercase function. After turning off all those "smart" options, I had restart the device for it to take effect. On the other hand, the on-screen virtual keyboard can input always letters correctly.

2) When the issue in (1) was happening, I was unable to input anything in Krita's "Search" boxes, like the one on Shortcut page in Configure Krita dialogue. On the other hand, I was able to input in Layer name fields, although they were all uppercased.

3) Shortcut customization cannot take key combinations with modifiers correctly. After pressing the button to record a shortcut, a key combination with any modifier will record multiple inputs, which Krita will not accept as valid input. For example, if I pressed "Ctrl+Q", the Shortcut Krita took was actually "Ctrl+Q,Ctrl+...(cannot be seen)". This shortcut would not be displayed in the "Short" or "Alternate" columns, and Krita would not remember it. This makes Shortcut customization with modifiers impossible under Android.
Comment 2 Tyson Tan 2022-12-12 07:21:42 UTC
Appenix to Comment 1:

After a factory reset, the issue where English inputs are always uppercased did not happen by default.

The device came with One UI 4.0, maybe the updated version 5.0 has default settings that solved the problem. 

Other issues remained the same.
Comment 3 Tyson Tan 2022-12-12 07:21:55 UTC
Workaround of Shift key conflict:

1) Use the samsung labeled, fallback input method. Disable all 3rd party input methods. Curiously, this is NOT the default setting. The device comes with a VERY popular 3rd party input method (Sogou) preinstalled, and uses that as the default).

2) Remove all input languages except English. In that way, Krita will never get confused by pressing Shift.
Comment 4 Tyson Tan 2022-12-16 13:38:20 UTC
Created attachment 154626 [details]
Invalid recoring of key combination when a modifier is pressed

In this screenshot, I was trying to assign the key combination "Ctrl+Q" to an action. However, it didn't just record "Ctrl+Q", but seemingly multiple of the same combination as a sequence (because there is comma between them). Notice how the key combination didn't show up in the Shortcut column, for some reason. This shortcut won't be remembered after clicking OK.
Comment 5 Tyson Tan 2022-12-16 13:39:55 UTC
The issue mentioned in Comment 4 is neither language or input method related. A pure English environment would have triggered the same thing.
Comment 6 matheushcdias 2024-11-21 13:56:56 UTC
Can confirm, had this issue on my tablet when I tried using Gboard instead of the default samsung keyboard. The keyboard popup always appeared when I had Gboard on and I was unable to use shortcuts. I didn't have to disable Gboard for it to work properly, only switched back to Samsung keyboard and it was fixed. It happens on any language too.