Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just purchase the new wired Mac keyboard:

enter image description here

Running on Gentoo Linux it works mostly fine. The only problem I am having is the function keys and swapping the Alt and Command keys to resemble a regular PC keyboard. When I tried switching to the "mac-us" keymap in /etc/conf.d/keymaps I got garbage when typing (not even qwerty).

Are there any specific keymaps I can use to get what I want?

share|improve this question

I don’t know if this will work for Gentoo, but it might if you are using xmodmap. I found a fix that worked on Fedora 14 for me from the Ubuntu community wiki:

To fix the Fn key issue, I did the following:

$ sudo bash
# echo 2 > /sys/module/hid_apple/parameters/fnmode
# exit

I added the following to ~/.Xmodmap to switch the Alt and keys:

! Swap Alt and Cmd keys.
keycode 37 =    Control_L
keycode 133 =   Alt_L Meta_L
keycode 64 =    Super_L
keycode 108 =   Super_R
keycode 134 =   ISO_Level3_Shift Multi_key
keycode 105 =   Control_R       Multi_key
clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5
add    Shift   = Shift_L Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L Control_R
add    Mod1    = Alt_L 0x007D
add    Mod2    = Num_Lock
add    Mod4    = Super_L Super_R
add    Mod5    = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift

! Configure '=' key on numpad as '='.
keycode 0x7D =  equal
share|improve this answer

I would use the normal keymap type (us/pc104) and use xmodmap or a XkbOptions setting in your xorg.conf to swap the alt and command keys. Read xmodmap for the first and /usr/share/X11/xkb/rules/xorg.lst for the second.

share|improve this answer

X or console? Probably the former. If yes, you can set more than just a keymap:

  • layout
  • model
  • variant
  • options

the model should match yours so just go through the list. a variant is to customize it further, ex., set a compose key. options can be "no dead keys" etc. Woth such you should be able to configure it (almost?) perfectly.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .