Difference between revisions of "Apple Keyboard"

From ArchWiki
Jump to: navigation, search
m (Removed spam links to irrelevant Mac OS X applications and sites.)
(have changed place with § and ½: Removed obsolete KDE instructions (apple:badmap option is no longer listed in systemsettings), added system-wide instructions)
Line 14: Line 14:
  
  
== < and > have changed place with § and ½ ==
+
==< and > have changed place with § and ½==
If the '''<''' and '''>''' are switched with the '''§''' and '''½''' keys, do the following:
+
If the '''<''' and '''>''' are switched with the '''§''' and '''½''' keys, run the following command:
  
 
  setxkbmap -option apple:badmap
 
  setxkbmap -option apple:badmap
  
Place that in '''~/.bash_profile''', or if you use KDE:
+
Place that command into '''~/.bashrc''' file to have it run automatically when you log in.
  
Go to the "Control Center" -> "Regional & Accessibility" -> "Keyboard Layout" and press the "Xkb Options" tab. Scroll down and check the "apple" and "Swap keycodes of..." checkboxes. Click on "Apply".
+
You can also apply the change system-wide by creating (or editing) '''/etc/X11/xorg.conf.d/10-keymap.conf''' as such:
 +
Section "InputClass"
 +
    Identifier "keyboard catchall"
 +
    MatchIsKeyboard "true"
 +
    Driver "evdev"
 +
    Option "XkbOptions" "apple:badmap"
 +
EndSection
  
If neither of these approaches seem to work, you can add these two lines to your '''~/.Xmodmap''' file:
+
 
 +
If the above approach doesn't seem to work, you can add these two lines to your '''~/.Xmodmap''' file:
  
 
  keycode  49 = less greater less greater bar brokenbar
 
  keycode  49 = less greater less greater bar brokenbar
 
  keycode  94 = section degree section degree notsign notsign
 
  keycode  94 = section degree section degree notsign notsign
  
if you use an canadian multilingual layout (where the "ù" and the "/" is switch) use this :
+
If you use a Canadian multilingual layout (where the "ù" and the "/" is switch) use this :
  
 
  keycode  94 = slash backslash slash backslash bar brokenbar
 
  keycode  94 = slash backslash slash backslash bar brokenbar
 
  keycode  49 = ugrave Ugrave ugrave Ugrave notsign notsign
 
  keycode  49 = ugrave Ugrave ugrave Ugrave notsign notsign
  
Then run '''xmodmap ~/.Xmodmap'''.
+
Then run '''xmodmap ~/.Xmodmap'''. This command can also go into '''~/.bashrc'''.
  
 
== Keysym mapping ==
 
== Keysym mapping ==

Revision as of 20:13, 1 September 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Function keys don't work

If your F<num> keys do not work, this is probably because the kernel driver for the keyboard has defaulted to using the media keys and requiring you to use the Fn key to get to the F<num> keys. To change this behaviour, you have to change a driver setting. Do the following as root:

echo 2 > /sys/module/hid_apple/parameters/fnmode

If it tells you that the file doesn't exist, you probably have an older kernel and will have to do the following instead:

echo 2 > /sys/module/hid/parameters/pb_fnmode

Place whichever command worked for you in /etc/rc.local to make the setting permanent.


< and > have changed place with § and ½

If the < and > are switched with the § and ½ keys, run the following command:

setxkbmap -option apple:badmap

Place that command into ~/.bashrc file to have it run automatically when you log in.

You can also apply the change system-wide by creating (or editing) /etc/X11/xorg.conf.d/10-keymap.conf as such:

Section "InputClass"
    Identifier "keyboard catchall"
    MatchIsKeyboard "true"
    Driver "evdev"
    Option "XkbOptions" "apple:badmap"
EndSection


If the above approach doesn't seem to work, you can add these two lines to your ~/.Xmodmap file:

keycode  49 = less greater less greater bar brokenbar
keycode  94 = section degree section degree notsign notsign

If you use a Canadian multilingual layout (where the "ù" and the "/" is switch) use this :

keycode  94 = slash backslash slash backslash bar brokenbar
keycode  49 = ugrave Ugrave ugrave Ugrave notsign notsign

Then run xmodmap ~/.Xmodmap. This command can also go into ~/.bashrc.

Keysym mapping

To map the appropriate functions to your "media" keys place the following in ~/.Xmodmap:

keycode 160 = XF86AudioMute
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume

keycode 144 = XF86AudioPrev
keycode 162 = XF86AudioPlay
keycode 153 = XF86AudioNext

keycode 101 = XF86MonBrightnessDown
keycode 212 = XF86MonBrightnessUp

keycode 204 = XF86Eject

and run xmodmap ~/.Xmodmap. For more information about these mappings see Extra Keyboard Keys in Xorg.