Upgrading from Ubuntu Gutsy (7.10) to Hardy (8.04) in MacBook: The missing “right mouse click / button”
In my former post: Ubuntu 7.10 (Gutsy) on a Macbook … Part 1, I mentioned:
“I noticed some of the devices/hardware does not work properly on Ubuntu “out-of-the-box” (default install of Ubuntu 7.10 for intel) like sound volume control, iSight, sound recording through the built-in mic. To some of us who are used to doing “right clicks” on the mouse, we need to have an alternative way of doing it given that all Mac laptops only has one built-in “mouse” button that works as a “left button”.
Well, the website:
How to install Ubuntu on a MacBook
[url: https://help.ubuntu.com/community/MacBook] has been useful since following the instructions have made sound (volume control and recording through the built-in mic and iSight (built-in webcam) worked in my MacBook. I also have converted the lower “enter” key to be a “right mouse button.”
While everything continued to work even after upgrading from Gutsy (7.10) to Hardy (8.04), I noticed my lower “enter” key doesn’t worked anymore. So, based from the instruction on the above website, I tried to do again:
“On Ubuntu: Go to System ▸ Preferences ▸ Keyboard ▸ Accessibility in the Main menu. Check Enable keyboard accessibility features. Click the Mouse Keys tab and check Enable Mouse Keys also.”
I found out that the “Keyboard” preferences is already different in Hardy:
- Accessibility Tab does not contain anymore the checkbox for “Enable keyboard accessibility features”
- Mouse Keys Tab does not contain also the checkbox for “Enable Mouse Keys”
So, I here’s what needs to be done:
1. Go to System > Preferences > Keyboard > Accessibility tab > under General, enable “Allow to turn accessibility features on and off from the keyboard”
2. Then go to System > Preferences > Keyboard > Mouse Keys tab and then enable “Allow to control the pointer using the keyboard”
3. Create a text file in your home directory named: .xmodmap containing the following text:
keycode 116 = Pointer_Button3
Note:
- This sets Right “Apple” key (left side of the “space” key of the Mac keyboard) as Right mouse click
- Keycodes for right “Apple” key – keycode 116, and lower “enter” key – keycode 108. So, if you have a lower “enter” key and you want to use that instead of the right “Apple” key just change “keycode 116″ to “keycode 108″ in your .xmodmap file
- “Pointer_Button3″ is for the Right-click input event while “Pointer_Button2″ is for Middle-click input event. So if you want to add a middle-click just add another line in your .xmodmap file e.g. “keycode 108 = Pointer_Button2″. This will make your lower “enter” key the middle-click. Based on your preference you can even exchange the two. Here’s an example content of .xmodmap for right “Apple” key as your Middle mouse click and lower “enter” key as your right mouse click:
keycode 116 = Pointer_Button2
keycode 108 = Pointer_Button3
4. Add a call to xmodmap to your startup applications. Go to System > Preferences > Sessions.
For example:
Name: xmodmap
Command: xmodmap /home/user/.xmodmap
5. Restart X either by (Ctrl+Alt+Backspace) or by logging-out and then logging-in again for the changes to take effect, and load the xmodmap.
References:
https://help.ubuntu.com/community/MacBook#Keyboard%20layouts
https://help.ubuntu.com/community/MacBookPro#Right%20/%20Middle%20Clicking
