Bad mapping for right-click on Macs etc

Bug #46378 reported by Scott James Remnant (Canonical) on 2006-05-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xkeyboard-config (Ubuntu)

Bug Description

The right-click key appears to be mapped to F12, which on a PowerBook G4 is the key labelled "Eject", not exactly discoverable, especially on a LiveCD!

sam tygier (samtygier) wrote :

how do i right click is a very common question in the powerpc forum.

any suggestions?
CTRL+click or click-and-hold-for-a-second is used for a contextual menu in mac os.

an option to choose a right-click emulation method in the mouse prefs would be resonably discoverable. (its where i would look first)

mac os (and most mac applications) are fully usable without a right click. maybe gnome _requiring_ two mouse buttons is the bug.

Rodrigo Novo (rodarvus) wrote :

Reassigning to the relevant package.

mog (launchpad-net-mog) wrote :

This is still true. Should this 2 year old bug still be open?

Thanks for the tip on using Eject/F12.

Bryce Harrington (bryce) wrote :

Hi scott,

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with the latest development release of Ubuntu? (ISOs are available from

If it remains an issue, could you also attach a new /var/log/Xorg.0.log?
Thanks in advance.

The output of lspci -vvnn would also be worth having.

Changed in xkeyboard-config:
status: New → Incomplete

F12 is still the right-mouse emulation key

Changed in xkeyboard-config:
status: Incomplete → Confirmed

I'd also point out that on the newest Macbooks, F12 isn't even on the keyboard as a standard key - and you have to use Fn to access it

Bryce Harrington (bryce) on 2008-11-10
Changed in xkeyboard-config:
status: Confirmed → Triaged

Forwarding this bug report from a Ubuntu reporter:

On Macbooks, the right mouse button is mapped to the F12 key, however on recent model Macbooks the F12 key is no longer present on the standard keyboard (requires the Fn key now), making this particularly troublesome now.

A re-mapping of the right mouse button would be worthwhile even for older macbooks, as the current mapping has been a source of confusion among powerbook users for quite some time.

The Debian MacBook guide includes a suggestion of using the left "Command" key as the right mouse button. . We'd like to know what upstream would think of this idea, or if a different idea would be better?

Changed in xkeyboard-config:
status: Unknown → Confirmed

I located a document by Debian including a suggestion (below) of using the left side Command key for the right mouse button. I've never used a macbook myself; can you folks share your feelings on this idea?
"I like the Left side "Command" key on my keyboard as the third mouse button, here's how I did it:
    * Start gnome-terminal
    * Run xev, it will display the X11 events it picks up
    * Locate the keycode of the key you want to use:
          o Press the key you want locate and locate the KeyPress event in gnome-terminal
          o Write down the keycode of the keyevent
    * Run xmodmap -e "keycode 115 = Pointer_Button3" to update your keyboard map (for this login session only)
    * Add to gnome-session-properties to enable every session. "

I've also forwarded this idea upstream to xkeyboard-config for their feedback. In googling around for other alternative suggestions, there were also ideas to use Fn + Ctrl + Click, but I'm not sure that addresses the discoverability issue as well. Any other preferences for remapping?

(Fwiw, in googling around on this topic, there certainly is a considerable amount of confusion among users on how to right-click.)

XKB cannot map keys to mouse buttons. You can try convincing people dealing with evdev driver to provide you with some special option (in xorg.conf) - in that case, feel free to reopen the bug and assign to product xorg, component Input/Evdev or smth

Changed in xkeyboard-config:
status: Confirmed → Invalid

XKB has a limited ability to map keys to mouse buttons/movements through

or as described in the Debian Wiki link:
xmodmap -e "keycode 115 = Pointer_Button3"

Oops. Right. Sorry, I totally forgot about mousekeys. Have to think about it again.

Thanks, Alan

Changed in xkeyboard-config:
status: Invalid → Confirmed

I've just tried to map LWIN to Pointer_Button3. It works in a sense that xev displays that keysym. But Firefox does not react on that "button". Neither other apps.

In the interpret section, I see

    interpret Pointer_Button3+AnyOfOrNone(all) {
        action= PtrBtn(button=3);

which looks logical. Anything I am missing?

PS Just checked, Shift+Numlock switched me ok into working mousekeys mode.

Some users I've talked to report that right click on Intrepid works fine with three-finger tapping.

mog (launchpad-net-mog) wrote :

Three-finger tapping/two finger scrolling only works if you have a modern macbook pro with the new multi-touch touchpads. Not sure which model it was introduced in but my old Powerbook G4 doesn't support it.

Dima Ryazanov (dima-gmail) wrote :

My new next-gen macbook doesn't work with it, either.

Matthew Paul Thomas (mpt) wrote :

Bryce, we are considering using the Command key alone (and, on Windows keyboards, the Windows key alone) for other things in future. This would conflict with using it to emulate right-clicking.

Mac OS uses Ctrl click to emulate right-clicking, but Ubuntu uses Ctrl click for other things (e.g. to open a link in a new window/tab). Another possibility would be to use Fn+click. (Are there any relevant Mac keyboards now that don't have an Fn key?)

Either this bug has nothing to do with PowerPC and should be resummarized, or bug 122962 (which is about MacBooks) is not a duplicate.

b (ben-ekran) wrote :

I'm running an up to date intrepid on a powerbook5,2.

I was running this machine with hardy just fine. F11 and F12 mapped to middle and right buttons.

After upgrading to intrepid those F keys no longer work.

/etc/sysctl.d/10-arch-specific.conf contains:

# PowerPC:
# Emulate the middle mouse button with F11 and the right with F12.
dev.mac_hid.mouse_button_emulation = 1
dev.mac_hid.mouse_button2_keycode = 87
dev.mac_hid.mouse_button3_keycode = 88

In XEV, the F11 and F12 keys (with or without Fn being pressed) return:

KeyPress event, serial 30, synthetic NO, window 0x1400001,
    root 0x67, subw 0x0, time 1383298, (134,56), root:(685,404),
    state 0x0, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x1400001,
    root 0x67, subw 0x0, time 1383347, (134,56), root:(685,404),
    state 0x0, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x1400001,
    root 0x67, subw 0x0, time 1392454, (134,56), root:(685,404),
    state 0x0, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x1400001,
    root 0x67, subw 0x0, time 1392504, (134,56), root:(685,404),
    state 0x0, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

I tried using these keycodes (95 + 96) in 10-arch-specific.conf, but still those keys don't map to button clicks.

Using sysctl directly also appears to make no difference:

sudo sysctl dev.mac_hid.mouse_button2_keycode=95
sudo sysctl dev.mac_hid.mouse_button3_keycode=96

My only guess is that the keycodes themselves are messed up. Or sysctl is causing issues.

The XFCE config present when installing xubuntu-desktop on ubuntu is utterly useless without, at least, the right click mapping. On this arch this bug is of more than medium importance.

Actualy, you should take 8 units from the keycode in order to it work. So, the 96 keycode should be set as 88 and so on.. as follows:

#will emulate the middle button on the F11 key (95)
sudo sysctl dev.mac_hid.mouse_button2_keycode=87
#will emulate the right button on the F12 key (96)
sudo sysctl dev.mac_hid.mouse_button3_keycode=98

What I am trying to do is to emulate the right button as pressing the litle <enter> button(keycode 104) + the trackpad click, but no success yet.


I am going to try now the mouseemu + upstart.

Oh, by the way, you'll need to run this to after changing the keysmap:

sudo invoke-rc.d procps start

Bryce Harrington (bryce) on 2009-09-02
tags: added: ppc
summary: - Bad mapping for Right-Click on PowerPC
+ Bad mapping for right-click on MacBooks etc
tags: removed: ppc

Could we not just set two finger clicking or ctrl-click as right click as default?

2009/11/7 David Stansby <email address hidden>:
> Could we not just set two finger clicking or ctrl-click as right click
> as default?

Karmic sets by default the following:
2-finger click - right click
3-finger click - middle click
You just have to enable 2-finger touchpad scrolling in Mouse preferences.

## Przemysław Kulczycki >><< Azrael Nightwalker ##
# jabber: azrael[na] | tlen: azrael29a #
### www: ###

So if that's the case then there's not problem at all for MacBooks.

summary: - Bad mapping for right-click on MacBooks etc
+ Bad mapping for right-click on Macs etc
tags: added: iso-testing
Bryce Harrington (bryce) on 2010-03-04
Changed in xkeyboard-config (Ubuntu):
status: Triaged → Fix Released
Changed in xkeyboard-config:
importance: Unknown → Medium
Changed in xkeyboard-config:
importance: Medium → Unknown
Changed in xkeyboard-config:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.