I’ve had to contend with a few little annoyances since installing Ubuntu 7.10 on my new MacBook Pro, so here’s a short list of things that might help if you find yourself with the same issues I’ve had.
Problem: The CapsLock and NumLock LEDs don’t light up. To make matters worse, the NumLock key occasionally locks on, particularly after sleep, and the keyboard becomes essentially useless.
Solution: Uninstall mouseemu. It seems to be the source of this evil.
Problem: Without mouseemu, there’s no way to use middle and right click from the keyboard.
As long as you don’t need the mouse outside of X and don’t really care whether NumLock actually results in numbers rather than mouse movements, you can solve this with xmodmap and mouse keys support. In short:
- Turn on mouse keys. Within Gnome, that’s under System → Preferences → Universal Access → Keyboard Accessibility; select Enable Keyboard Accessibility Features, then go to the Mouse Keys tab and Enable Mouse Keys.
- Create a file called .xmodmaprc in your home directory with the following contents:
keycode 95 = Pointer_Button2 keycode 96 = Pointer_Button3
These keycodes correspond to F11 and F12 for me — you can change them to whatever you’d prefer for the middle and right click functions. xev will give you the keycodes for the keys you want.
- Ensure that the modmap is loaded when you log in. In Gnome, this can be done through the System → Preferences → Sessions dialog box. Click Add to add an additional startup program, then ensure that the command is xmodmap /home/USER/.xmodmaprc, replacing USER with your username. Give it any name and hit OK, then close the session preferences.
- Log out and log back in. The first time you log in, you should get a dialog box from xmodmap to confirm that you want to load the .xmodmaprc file — confirm that you do and that you don’t want to be asked each time, and from then on you should have the goodness of three mouse buttons again.
Problem: The keyboard backlight doesn’t work or I can’t change the display backlight brightness.
- There’s a kernel module that needs to be loaded for some of these features to work. The easiest way to do it is to edit /etc/modules and appending the line
applesmc. This will ensure it’s loaded on subsequent boots.
- Load the applesmc module at the command line using sudo modprobe applesmc.
- Install pommed (available in the universe repository, so ensure that’s enabled). These things will start working. If you’d prefer to use the function key to change volume or brightness, you can do this by editing /etc/pommed.conf and changing fnmode to 2.
Most of this is pretty minor in the grand scheme of things — it was really the issue of NumLock freezing the keyboard (particularly on waking from sleep, although I’ve had it happen a couple of times in general use as well) that led me to start looking into this. I have a Rev. D MacBook Pro, so it may be that many of these things aren’t issues on the older hardware; I don’t recommend blindly doing any of this unless you know you have a problem.