I am running Ubuntu 16.10 on a MacbookPro and keys 49 and 94 are inverted... I resolved this problem with xmodmap, but this won't apply permanently. After some research I found xmodmap is no longuer use by Ubuntu but xkb instead. So I searched in the configuration of xkb and I found in the config file /usr/share/X11/xkb/keycodes/macintosh this lines :

xkb_keycodes "badmap" {
    <TLDE> =  94;
    <LSGT> =  49;

xkb_keycodes "goodmap" {
    <TLDE> =  49;
    <LSGT> =  94;

This is exactly my problem, this two keys are inverted. So I wondering if I can't change my layout configuration with the param badmap.

The ouput of setxkbmap -query -v 10

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     fr,fr,us
variant:    mac,oss,
Trying to build keymap using the following components:
keycodes:   evdev+aliases(azerty)
types:      complete
compat:     complete
symbols:    pc+fr(mac)+fr(oss):2+us:3+inet(evdev)
geometry:   pc(pc105)
rules:      evdev
model:      pc105
layout:     fr,fr,us
variant:    mac,oss,
  • First: Do you know that your keyboard model is set correctly? – Gunnar Hjalmarsson Oct 30 '16 at 19:14
  • I think the keyboard layout is wrong, because when I switch in a different language layout like French, Swenden, etc I've got the same problem even if I select a no Macintosh layout. – Zagonine Oct 30 '16 at 19:24
  • No, I was talking about the model. Can you please run the command setxkbmap -query -v 10 and show us the output by editing your question. – Gunnar Hjalmarsson Oct 30 '16 at 19:37
  • I have edited the question. – Zagonine Oct 30 '16 at 20:28
  • I gave this a new try: Wrote a new answer and deleted the old one. – Gunnar Hjalmarsson Nov 3 '16 at 1:42

I accidentally stumbled upon this patch, which led me to the solution:

Open /etc/default/keyboard for editing and set:


At next reboot those keys will be switched.

  • Big thanks to you ! This is exactly what I am looking for ! This solved my problem. Thank you ! – Zagonine Nov 28 '16 at 19:22

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.