Home > Linux > Linux and Apple keyboard

Linux and Apple keyboard

I got a slim aluminum USB keyboard from Apple for my Linux workstation running Ubuntu 9.04 at work. It’s great: small, low-profile, and quiet. I use the same, but wireless for my media center at home and love it. I own a MacBook and want to have the same typing experience on all computers I use every day.

I also tried the bluetooth version of that keyboard with a partial success. The keyboard paired and worked until I rebooted the system. After that I needed a wired keyboard to log in and connect with the keyboard again.

The keyboard is small and does not have all the keys available. A small Alt key is very annoying and I decided to map an unused Command key to Alt. Another drawback is that there is no Delete key (although a Backspace key is labeled ‘delete’). Eject button is a perfect candidate for Delete.

I used ‘xev’ tool to read the keycodes of various keys and came up with a mapping that can be applied with xmodmap command. Here is my ~/.xmodmap file:

clear Mod4
keycode 133 = Alt_L Meta_L
keycode 134 = Alt_R Meta_R
keycode 169 = Delete

In Ubuntu desktop, Eject key is mapped using Keyboard Shortcuts preferences applications and that mapping must be removed first.

What I can’t do is map the Up and Down keys with a modifier to get PageUp and PageDown. Once I find a solution to that I’ll post it here.

I’m also using the Mighty Mouse by Apple. It’s OK but has some annoyances. Pressing the middle button, the scroll-wheel, causes the wheel to turn and scroll. The side buttons are oversensitive and just by touching them when using Firefox the back button is invoked sending you back in the browsing history. The later problem can be fixed with xmodmap by shifting the button order. The side button has a number 8. Replacing it with 15 solves the problem. Add the following line to the ~/.xmodmap file:

pointer = 1 2 3 4 5 6 7 15 9 10 11 12 13 14 8

I also disabled horizontal scrolling by moving 6 and 7 to the end of the list just like above.

pointer = 1 2 3 4 5 13 14 15 9 10 11 12 6 7 8

I’m also using the Mighty Mouse by Apple. It’s OK but has some annoyances. Pressing the middle button, the scroll-wheel, causes the wheel to turn and scroll. The side buttons are oversensitive and just by touching them when using Firefox the back button is invoked sending you back in the browsing history. The later problem can be fixed with xmodmap by shifting the button order. The side button has a number 8. Replacing it with 15 solves the problem. Add the following line to the ~/.xmodmap file:

pointer = 1 2 3 4 5 6 7 15 9 10 11 12 13 14 8
Categories: Linux Tags:
  1. No comments yet.
*