Swapped keys on Macbook pro (French Macintosh keyboard, keys <> and @#)

Hi !

I installed Fedora 38 (with GNOME 44 DE) on an old 2010 MacbookPro (7,1) laptop with French (France) keyboard.
I am using the French (Macintosh) keyboard layout.
Two of my keys are swapped : less/greater <> and at/numbersign @#

I have looked at GNOME Tweaks “additional layout options” but I don’t see an option to sawp these keys.

I haven’t found similar topics here, but on french Ubuntu forums, for example here : [Résolu] Inverser les touches <> et @# clavier apple / Autres types de matériel / Forum Ubuntu-fr.org
So I have tried the recommended method (post #17), xmodmap -e 'keycode 94=at numbersign periodcentered Ydiaeresis' -e 'keycode 49=less greater less greater', but it doesn’t do anything.
From the same topic (post #38, page 2), I also tried creating a custom keyboard layout, but it doesn’t work either.

Any idea what I should try next, and why xmodmap doesn’t work ?

Are other users encountering the same problem, and if so, should I report this issue ? Is it specific to French MacbookPro keyboards, or is this common on other layouts ?

Thanks :slight_smile:

Hello.

To solve the same issue i use :

. For the actual session :
$ sudo echo 1 | sudo tee /sys/module/hid_apple/parameters/iso_layout

. To apply permanently :
$ sudo echo options hid_apple iso_layout=1 | sudo tee -a /etc/modprobe.d/hid_apple.conf

Regards.

Denez

1 Like

Works great, thank you so much !

Cheers

worked for me too. thank you for that.
by the way, how could i get proper keymap in tty too ?
in tty i’m getting the plain “fr” keymap which is all wrong and make me always struggle to find some keys, typing in blind mode to try to find keys: “|, \, -, *, {, }, [, ]” (and many others), instead of having the mac variant like i do in wayland and that is correct.

update:
it seems i got it working by tweaking /etc/vconsole.conf like so:

KEYMAP=fr-mac
XKBLAYOUT=fr
XKBMODEL=microsoftpro
XKBVARIANT=mac
XKBOPTIONS=terminate:ctrl_alt_bksp
FONT=latarcyrheb-sun32

i was tweaking the file, testing various settings, maybe some of the above is not completely correct, but in practice it seems to work as expected.

Thanks for this, help me a lot :pray:

But since I already switch behavior of F1…F12 keys (following this post) using /etc/modprobe.d/hid_apple.conf the change didn’t persist between reboot, I guess GRUB take over :person_shrugging:

Anyway, in my case the solution was to set this parameter with GRUB also using the following command:

sudo grubby --update-kernel=ALL --args="hid_apple.iso_layout=1"