Bug 479442 - Apple Aluminium keyboard (ISO) cannot be properly used
Summary: Apple Aluminium keyboard (ISO) cannot be properly used
Status: REPORTED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 5.27.10
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-05 17:06 UTC by nathan67003
Modified: 2024-10-17 18:28 UTC (History)
6 users (show)

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


Attachments
Text file laying out key effects of an Apple Aluminium ISO keyboard under French Canadian - CSA layout on macOS 10.14 (2.72 KB, text/plain)
2024-01-05 17:06 UTC, nathan67003
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nathan67003 2024-01-05 17:06:02 UTC
Created attachment 164692 [details]
Text file laying out key effects of an Apple Aluminium ISO keyboard under French Canadian - CSA layout on macOS 10.14

SUMMARY
***
I am using an Apple Aluminium keyboard (ISO) with a Kubuntu 22.04.3 LTS install and using the French(Canada) International layout variant. Just the preview has problems: Meta and Alt are both on Alt and the actual Meta keys do not respond and are not assigned (on the preview - they still work as meta keys for certain purposes). Additionally, the right and left modifier keys are not considered equivalent (right alt is designated as ISO level 3 shift, right Control as ISO level 5 etc. despite both sides being symmetrical in use on macOS). The mappings for the Apple Aluminium (ISO) layout should match the mappings for the layout as used in macOS.
***


STEPS TO REPRODUCE
1. Have an Apple Aluminium ISO keyboard connected.
2. Set up a shortcut which works under "generic" keyboards and ensure it works.
3. Switch the keyboard model to Apple Aluminium (ISO).

OBSERVED RESULT
It is no longer possible to use shortcuts, even if they are assigned again using the new keyboard properties. Several tertiary and quaternary characters ("`", "ß", "§") require pressing one side of the keyboard or different keys of the keyboard than on macOS ("`" requires using right alt instead of [], "ß" requires using right control instead of [], "§" requires using right control + (any)Shift instead of []).

EXPECTED RESULT
All key inputs (not input results, so alt+s should do option+s = ß with French Canadian CSA for instance) behave as expected from how they are labeled and the events they trigger.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04.3 LTS? (Not sure what to put here.)
(available in About System)
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
N.B: This may be current for any number of Apple keyboard models, I unfortunately cannot test them.

Attached is a .txt running through all the keys of my Apple Aluminium ISO keyboard and their effects with various modifier keys pressed on macOS 10.14.
Comment 1 John Veitch 2024-10-17 08:45:51 UTC
I have an Apple Aluminium Keyboard with British keycaps and have a problem on Plasma 6.1.5 on Wayland. The ` and \ keys are swapped in KDE applications, although strangely they are not swapped in Chrome!
To make matters worse, the preview function in the Keyboard setting page doesn't work. The error is


Keycodes above 256 (e.g. <I256>) are not supported by X and are ignored
Error:            No Symbols named "mac" in the include file "macintosh_vndr/gb"
                  Exiting
                  Abandoning symbols file "(null)"
Comment 2 Wismill 2024-10-17 17:42:38 UTC
@nathan67003: could you provide the keycode of each modifier? You may use `evtest` for this. It would help to have the following mapping:

physical modifier (in maCOS idiom) + {left,right} side   ->   Linux keycode (e.g. `code 46 (KEY_C)` part of evtest output)

so I can identify what are exactly the mismatches.
Comment 3 Wismill 2024-10-17 17:43:11 UTC
(In reply to John Veitch from comment #1)
> I have an Apple Aluminium Keyboard with British keycaps and have a problem
> on Plasma 6.1.5 on Wayland. The ` and \ keys are swapped in KDE
> applications, although strangely they are not swapped in Chrome!
> To make matters worse, the preview function in the Keyboard setting page
> doesn't work. The error is […]
I believe this is this upstream bug: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/issues/334
Comment 4 nathan67003 2024-10-17 18:24:57 UTC
(In reply to @Wismill from comment #2)
For several reasons, I've had to purge the kubuntu partition from my Apple PC; I did, however, have an Ubuntu VM lying around and ran evtest on that.

Results:
Shift left side -> code 42 (KEY_LEFTSHIFT)
Shift right side -> code 54 (KEY_RIGHTSHIFT)
Ctrl left side -> code 29 (KEY_LEFTCTRL)
Ctrl right side -> code 97 (KEY_RIGHTCTRL)
Alt left side -> code 56 (KEY_LEFTALT)
Alt right side -> code 100 (KEY_RIGHTALT)
Cmd left side -> code 125 (KEY_LEFTMETA)
Cmd right side -> code 126 (KEY_RIGHTMETA)

...seeing the above and after digging through the config files I'd modified and saved externally to my Kubuntu partition, I'm no longer sure if this is a hardware interpretation issue or a use case issue. For instance, Alt+most letters does an ISO level 2 shift, allowing me to type ß with the S key; Alt + Shift + S allows me to type § with what I assume is an ISO level 3 shift; ISO level 4 (Ctrl + Shift) gives the same thing in this case, etc. Cmd does not like a Windows key and bring up a menu but serves as a sort of, well, "command" prefix for most app or system command shortcuts. Noteworthy is that both sides of the keyboard give indistinguishable results under all circumstances as well; there is no, as far as I'm aware, dedicated ISO level 3 shift key.

I may have mistakenly reported this as a bug as I was unable to find any set of settings or parameters that would allow similar behaviour to that outlined above and in the text file first attached to the bug; if this is indeed the case, feel free to berate me for wasting (hopefully very little of) your time and I'll keep resorting to manually overhauling the entire keyboard with keyd and modified keyboard layout files or something to that effect.
Comment 5 nathan67003 2024-10-17 18:28:50 UTC
I'm either blind (can't tell how to edit a comment) or daft (forgot to add details) but I'll add that on Mac, for instance, alt-tabbing is done via Cmd + Tab, for example.