个人工具

“UbuntuHelp:AppleKeyboard”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第19行: 第19行:
 
</nowiki></pre>
 
</nowiki></pre>
 
* Reboot
 
* Reboot
 +
Alternatively, you can modify '''/etc/rc.local''' to similar effect.
 +
* Edit the '''/etc/rc.local''' file:
 +
<pre><nowiki>
 +
sudo gedit /etc/rc.local
 +
</nowiki></pre>
 +
* Add this line to the end of the file:
 +
<pre><nowiki>
 +
echo 2 > /sys/module/hid/parameters/pb_fnmode
 +
</nowiki></pre>
 
=== Adding an Insert key, swapping Alt/Cmd positions and more ===
 
=== Adding an Insert key, swapping Alt/Cmd positions and more ===
 
To make the keyboard work more like a normal PC keyboard add the following to your '''~/.Xmodmap''' file. Add the file if there is none.
 
To make the keyboard work more like a normal PC keyboard add the following to your '''~/.Xmodmap''' file. Add the file if there is none.
 +
For Ubuntu 8.04 (Hardy) with kernel >= 2.6.27:
 
<pre><nowiki>
 
<pre><nowiki>
 
! Configure F13 as Insert key, F14 as PrintScr, F15 as ScrollLock
 
! Configure F13 as Insert key, F14 as PrintScr, F15 as ScrollLock
第52行: 第62行:
 
add    Mod4    = Super_L Super_R
 
add    Mod4    = Super_L Super_R
 
add    Mod5    = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift
 
add    Mod5    = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift
 
! Configure F17 as F13, F18 as F14 and F19 as F15.
 
keycode 131  =  F13
 
keycode 247  =  F14
 
keycode 132  =  F15
 
  
 
! Configure '=' key on numpad as '='.
 
! Configure '=' key on numpad as '='.
 
keycode 0x9D =  equal
 
keycode 0x9D =  equal
 +
</nowiki></pre>
 +
For Ubuntu 8.10 (Intrepid):
 +
<pre><nowiki>
 +
! Configure F13 as Insert key, F14 as PrintScr, F15 as ScrollLock
 +
! and F16 as Pause/Break.
 +
keycode 191  = Insert
 +
keycode 192  = Print Sys_Req
 +
keycode 193  = Scroll_Lock
 +
keycode 194  =  Pause Break
 +
keycode 195  =  XF86AudioMute
 +
keycode 196  =  XF86AudioPrev
 +
keycode 197  =  XF86AudioNext
 +
 +
! 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    = 0 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
 
</nowiki></pre>
 
</nowiki></pre>
 
After the next login the keys should function as described in the file. You can also manually activate the new layout by calling
 
After the next login the keys should function as described in the file. You can also manually activate the new layout by calling

2008年12月16日 (二) 17:53的版本


Preface

Since Ubuntu 8.04 (Hardy Heron) the USB aluminium Apple Keyboard has not worked correctly. A change was added to the Ubuntu Linux kernel to make Apple MacBook keyboards gain additional functionality to their limited laptop style keyboard (Ubuntu bug #162083). Unfortunately this code change has some side effects for owners of the full size USB aluminium Apple Keyboard:

  • Function keys have media functions as default. The "fn" key must be pressed and held to access the F-key functionality (except F5 and F6, which are inverted in this respect). (Ubuntu bug #201711)
  • Num lock key will when pressed render the keyboard seemingly unusable. The keyboard will simulate a numeric keypad on the alphabet keys. Pressing F6 twice will exit this mode. (Ubuntu bug #201887)
  • Two keys are swapped on international (non-US) keyboard with respect to the printing on the keycaps. (Ubuntu bug #214786)
  • Bug filled by me in the main kernel bugzilla http://bugzilla.kernel.org/show_bug.cgi?id=10818 Please help if you think (as I) that the kernel developers are wrong, assuming that the keyboard have to behave like under MacOS.

Corrections

Correcting the Function Key and Num Lock issue

  • Edit the file /etc/modprobe.d/options, e.g.:
sudo gedit /etc/modprobe.d/options
  • Add the line: options hid pb_fnmode=0
  • Save the file and execute the following command:
sudo update-initramfs -u
  • Reboot

Alternatively, you can modify /etc/rc.local to similar effect.

  • Edit the /etc/rc.local file:
sudo gedit /etc/rc.local
  • Add this line to the end of the file:
echo 2 > /sys/module/hid/parameters/pb_fnmode

Adding an Insert key, swapping Alt/Cmd positions and more

To make the keyboard work more like a normal PC keyboard add the following to your ~/.Xmodmap file. Add the file if there is none. For Ubuntu 8.04 (Hardy) with kernel >= 2.6.27:

! Configure F13 as Insert key, F14 as PrintScr, F15 as ScrollLock
! and F16 as Pause/Break.
keycode 182 = Insert
keycode 183  =  Print       Sys_Req
keycode 184  =  Scroll_Lock
keycode 93   =  Pause   Break

! Swap Alt and Cmd keys.
keycode 0x25 =  Control_L
keycode 0x73 =  Alt_L       Meta_L
keycode 0x40 =  Super_L
keycode 0x71 =  Super_R
keycode 0x74 =  ISO_Level3_Shift    Multi_key
keycode 0x75 =  NoSymbol
keycode 0x6D =  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    = 0 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 0x9D =  equal

For Ubuntu 8.10 (Intrepid):

! Configure F13 as Insert key, F14 as PrintScr, F15 as ScrollLock
! and F16 as Pause/Break.
keycode 191  = Insert
keycode 192  = Print Sys_Req
keycode 193  = Scroll_Lock
keycode 194  =  Pause Break
keycode 195  =  XF86AudioMute
keycode 196  =  XF86AudioPrev
keycode 197  =  XF86AudioNext

! 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    = 0 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

After the next login the keys should function as described in the file. You can also manually activate the new layout by calling

xmodmap ~/.Xmodmap

from the command line.

Correcting the two swapped keys for international (non-US) keyboards

  • Open the 'System->Preferences->Keyboard' dialog
  • Choose the 'Layouts' tab
  • Press 'Layout Options...'
  • Navigate to 'Miscellaneous compatibility options'
  • Enable the option: Swap keycodes of two keys when Mac keyboards are misdetected by kernel.

Belgian Macintosh Keyboard Layout

Take a look at https://help.ubuntu.com/community/Macbook_Air#head-5fd0bcf04cc7da0b5241950916bab5d58cdb84da in the Belgian Keyboard section

Postscript

These issues may also apply for the Bluetooth aluminium Apple Wireless Keyboard.