Bad mapping for right-click on Macs etc

Bug #46378 reported by Scott James Remnant (Canonical)
32
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xkeyboard-config
Unknown
Medium
xkeyboard-config (Ubuntu)
Fix Released
Medium
Unassigned

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!

Revision history for this message
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.

Revision history for this message
Rodrigo Novo (rodarvus) wrote :

Reassigning to the relevant package.

Revision history for this message
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.

Revision history for this message
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 cdimage.ubuntu.com)

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
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

F12 is still the right-mouse emulation key

Changed in xkeyboard-config:
status: Incomplete → Confirmed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

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)
Changed in xkeyboard-config:
status: Confirmed → Triaged
Revision history for this message
In , Bryce Harrington (bryce) wrote :

Forwarding this bug report from a Ubuntu reporter:
https://bugs.edge.launchpad.net/ubuntu/+source/xkeyboard-config/+bug/46378

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. http://wiki.debian.org/MacBook . 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
Revision history for this message
Bryce Harrington (bryce) wrote : Re: Bad mapping for Right-Click on PowerPC

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?

http://wiki.debian.org/MacBook:
"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.)

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

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
Revision history for this message
In , Alan Coopersmith (alan-coopersmith) wrote :

XKB has a limited ability to map keys to mouse buttons/movements through
mousekeys:
http://cgit.freedesktop.org/xkeyboard-config/tree/compat/mousekeys

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

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

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

Thanks, Alan

Changed in xkeyboard-config:
status: Invalid → Confirmed
Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

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.

Revision history for this message
Bryce Harrington (bryce) wrote : Re: Bad mapping for Right-Click on PowerPC

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

Revision history for this message
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.

Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Luiz Marcelo Serique (luiz-marcelo-serique) wrote :

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.

Suggests?

I am going to try now the mouseemu + upstart.

Revision history for this message
Luiz Marcelo Serique (luiz-marcelo-serique) wrote :

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

sudo invoke-rc.d procps start

Bryce Harrington (bryce)
tags: added: ppc
summary: - Bad mapping for Right-Click on PowerPC
+ Bad mapping for right-click on MacBooks etc
tags: removed: ppc
Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote : Re: Bad mapping for right-click on MacBooks etc

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

Revision history for this message
Przemek K. (azrael) wrote : Re: [Bug 46378] Re: Bad mapping for right-click on MacBooks etc

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]jabster.pl | tlen: azrael29a #
### www: http://reksio.ftj.agh.edu.pl/~azrael/ ###

Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote : Re: Bad mapping for right-click on MacBooks etc

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)
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
Revision history for this message
In , Gitlab-migration (gitlab-migration) wrote :

-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/issues/66.

Changed in xkeyboard-config:
status: Confirmed → Unknown
To post a comment you must log in.
This report contains Public information  
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.