Ubuntu – Apple keyboard swap

applekeyboard

Hey:) I'm having a problem with an apple keyboard on my linux machine.

The less then / greater than key is swapped with my "°" key.
The less than / greater than key is usually on the right side of shift as it shows on the keyboard.

Do you guys know the solution to this problem?

Best Answer

  • (There must be perfect keyboard configuration files for your model/layout).

    Anyway, The old way:

    1 - find those keys:

    $ xmodmap -pke | grep -Pw "degree|less" > mychanges
    

    2 - edit "mychanges" to swap the keys. You probably have something like:

    keycode 94 = less greater less greater bar brokenbar bar
    keycode 49 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
    

    Swap the keys codes to:

    keycode 49 = less greater less greater bar brokenbar bar
    keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
    

    3 - activate the changes with

    xmodmap mychanges
    

    4 - if your are happy with the new behaviour, do

    cat mychanges >> ~/.Xmodmap
    

    This approach can be used to generic keyboard changes (in graphic mode)