Bug 456660 - Pressing backspace key on external keyboard reverts Plasma's keyboard layout to default when using a non-default keyboard layout and two keyboards
Summary: Pressing backspace key on external keyboard reverts Plasma's keyboard layout ...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Keyboard Layout widget (show other bugs)
Version: 5.24.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-12 23:39 UTC by Costas
Modified: 2022-07-15 21:08 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Costas 2022-07-12 23:39:43 UTC
SUMMARY

I use Ubuntu Studio 22.04 all updated. I have English as system language.

I have 2 keyboard layout languages (greek, English) set up in  'System Settings' > 'input devices' > 'Keyboard' / Layouts

If I switch keyboard languages via the 'Keyboard Layout' icon in the system tray (or shortcut, alt-shift, set up in System Settings' > 'input devices' > 'Keyboard' / Advanced) the language reverts to English when I delete with backspace. This happens everywhere (libreoffice, terminal, firefox etc)

However, if I set up two language input methods in  'System Settings' > Regional Settings' > 'Language' / Input Method and use the shortcut set in 'System Settings' > Regional Settings' > 'Language' / Global Config: Trigger Input Method (ctl + space) then my language of choice persists. 

If I have NOT set the languages in the Keyboard Layout, but ONLY in the Regional Settings / Language / Input Method, then I DO NOT get the panel icon in the system tray to let me know which language I am writing in when I switch with ctl+space, though the keyboard types in either greek or UK and persists even with backspace. 

If I have ONLY set the languages in the Keyboard Layout, but NOT in the Regional Settings / Language / Input Method, then I DO get the panel icon in the system tray to let me know which language I am writing in as I switch with alt+shift. However, backspace seems to revert the language (and the icon) to English. 

If I have set up English and Greek in BOTH places, then backspace reverts the language set as an Input Method. 

STEPS TO REPRODUCE
1. Add a second language in the Keyboard Layout and set a key combo to trigger change in layout
2. In the terminal or anywhere else, type with the 1st language, then switch keyboard layout, continue typing
3. Press delete and then continue typing

OBSERVED RESULT
3. As soon as you press backspace, the layout and language changes back to its original as set in the Input Method.

EXPECTED RESULT
4. Layout and Language should stay the same

SOFTWARE/OS VERSIONS
Operating System: Ubuntu Studio 22.04
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-40-lowlatency (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2

ADDITIONAL INFORMATION
There may be some fundamental problem with how I understand keyboard layouts etc but I am a proficient user, and if I have a problem then other could be confused too.
Comment 1 Nate Graham 2022-07-13 20:38:04 UTC
Thanks for the detailed bug report. However I cannot reproduce the issue with those steps to reproduce.
Comment 2 Costas 2022-07-13 22:12:31 UTC
(In reply to Nate Graham from comment #1)
> Thanks for the detailed bug report. However I cannot reproduce the issue
> with those steps to reproduce.

Thanks, Nate for checking. 
I think I need to re-install Ubuntu or purge my KDE installation to defaults because this is giving me a headache. Possibly something got installed that is causing the issue. I will try with the live version and then do a re-installation and report back (as I cannot boot with the newest kernel, I get a mtd has no name or something - something is wrong :))

Costas
Comment 3 Costas 2022-07-13 22:53:32 UTC
(In reply to Nate Graham from comment #1)
> Thanks for the detailed bug report. However I cannot reproduce the issue
> with those steps to reproduce.

Hi Nate, reporting back from trying the Ubuntu Studio Live USB and the problem is there as well.

This is the simplest most direct way to test it (not sure if we need the ubuntu studio live but this is what I tested)

Boot Ubuntu Studio Live
Select to try it
Once up and running, click the 'start' menu and click System Settings 
In the search box, type 'layout'
In the results, select Hardware / Input Devices / Keyboard
Select the second tab, 'layouts'
Tick 'configure layouts'
English US should be there, so add a second language (in this case, greek) and click apply
The language icon in the system tray will be visible on the panel
Open firefox and start typing in the address bar.
Then click on the language icon to change language
Type again in firefox address bar, should be with the new language
press backspace and see the language changing back to default

If this does not reproduce the error, then could it be a hardware issue? I have a mechanical keyboard, have not loaded any macros or anything. 

Thanks for checking it again,

Costas
Comment 4 Nate Graham 2022-07-14 15:00:37 UTC
Thanks for the detailed instructions. I downloaded the ISO and followed your instructions in a VM but I still couldn't get the issue to happen. Do you have another keyboard you can try?
Comment 5 Costas 2022-07-14 17:59:11 UTC
(In reply to Nate Graham from comment #4)
> Thanks for the detailed instructions. I downloaded the ISO and followed your
> instructions in a VM but I still couldn't get the issue to happen. Do you
> have another keyboard you can try?

The plot thickens! There was a missing hidden step that confuses everything now!!

Try this: 
1. have 2 keyboards (laptop and external)
2. Have 2 layouts (settings / input devices / keyboard / configure layouts: English and Greek)
3. Open KWrite
4. Type with keyboard 1 (should be in English)
5. Type with keyboard 2 (should be in English)
6. Change language on the panel by clicking on it
7. Type with keyboard 2 (should be in Greek)
8. Type with keyboard 1 and the language reverts back to English!
9. Try different combinations of the above for weirdness

I tried the above steps with a different keyboard to the one I had the problem with, on my laptop, with the live USB. 

The setting for switching layouts is Global. 

It seems that my PC keyboard triggers KDE to think it is a new keyboard every time I use it (backspace changes it and then any forward typing also changes it first time a key is pressed). This does not happen with any other keyboard (well, laptop and new external)

Not sure what I did but the 'broken' keyboard works now on my PC (I uninstalled any keyboard related packages). Although the language does not change, it tries to change (the language icon flashes), so something is still happening.

No idea what all these mean. Does KDE keep layout states for different keyboards? If so, mb my PC keyboard is weird and has a split personality.

Thanks for your patience!
Comment 6 Nate Graham 2022-07-15 21:08:13 UTC
Thanks, that seems relevant.