Bug 1216681

Summary: AltGr key gets stuck in virtual console after switching to Swedish keyboard layout's "mac" variant using `localectl`
Product: [openSUSE] openSUSE Tumbleweed Reporter: Kiang <no>
Component: BasesystemAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED NORESPONSE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: no, sbrabec
Version: CurrentFlags: sbrabec: needinfo? (no)
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
See Also: https://bugzilla.suse.com/show_bug.cgi?id=1219506
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Kiang 2023-10-29 15:04:10 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Build Identifier: 

Using a standard European keyboard (I use Swedish) with an AltGr key, after using `localectl` to switch to Swedish keyboard's MAC variant, virtual console would make AltGr stuck after typing `AltGr+Shift+<anything>`.

Reproducible: Always

Steps to Reproduce:
0. Get a European keyboard (I use Swedish) with an 'AltGr' key.
1. Log into any X11 GUI terminals and do
    sudo localectl set-x11-keymap se pc104 mac ctrl:nocaps
In fact any keyboard models (pc104 etc.) I've tried will reproduce the bug.
2. Press Ctrl+Alt+F1 to go from X11 to virtual console.
3. Try typing the '{' character by pressing AltGr+Right_Shift+8.

Actual Results:  
Now just press the '2' on your keyboard; but instead of '2', the character '@' is inserted because it seems to think that AltGr is still active, and in this Swedish layout '@' is AltGr+2. Similarly typing 'hckiang' produces 'ħ¢ĸ→æ”ŋ' as if the AltGr key is down. Now there're no easy ways to even shutdown the computer because you can't type any normal command/shortcuts any more. Not even Ctrl+Alt+F2 to switch back to X11. The only choice is to hit my laptop's power button to restart.

Expected Results:  
After pressing AltGr+Right_Shift+8 to input a '{', you can still type normally, such that keyboard sequence 'hckiang' should input 'hckiang' rather than 'ħ¢ĸ→æ”ŋ'.
Comment 1 Stanislav Brabec 2024-02-01 13:37:08 UTC
The AltGr should never stuck, even if loadkeys is called from the X11 console.

I am not able to reproduce it on openSUSE Leap 15.5. I'll try on Tumbleweed later.
Comment 2 Stanislav Brabec 2024-03-15 11:40:22 UTC
Are you still able to reproduce it in the recent Tumbleweed with kbd-2.6.3? (Or with Leap 15.5/15.6/ALP?
Comment 3 Stanislav Brabec 2024-05-20 11:49:54 UTC
Needed feedback was not provided. Please reopen, if you can reproduce with a current update. Please also provide exact name of keymap you use.