9

I finally convinced my wife to put Ubuntu on her Macbook. Unfortunately, she strongly prefers the Mac approach to right clicking: Ctrl+Button1. I have the trackpad set up to do a two finger touch = right-click, but she isn't having it.

Can anyone please, please, PLEASE help me figure this out. I've seen this question posted before, with no answers.

I also saw the mouseemu approach mentioned here, but it doesn't seem to work.

I also thought about using the built in System Preferences>Keyboard>Shortcuts>Custom Shortcut, but it doesn't allow a "left click."

I also thought about using CCSM and xdotool, but couldn't figure out how to get two xdotool (xdotool xdotool key super+l; xdootool click 1)options to turn into one (xdotool click 3). (Note: I switched the Ctrl key and the super/mac command key to make it more mac-like, hence the super+l).

If you have a workable solution -- please respond. A Mac to Ubuntu conversion is at stake!

[Ubuntu 15.10; MacbookPro 9,2]

K7AAY
  • 17,202
Rsync
  • 1,274
  • 6
  • 19
  • 32
  • is this what you are looking for? (the link is an old askubuntu post, with answer) – wutangforever Mar 09 '16 at 20:26
  • Thanks WTF. Unfortunately, she got frustrated and took it back before I could test! I did try that briefly and it didn't work, but don't recall if I logged out/rebooted to see if it worked then. I hope to have access to the computer again in the next few weeks... maybe... – Rsync Mar 12 '16 at 16:17
  • Even though is not releveant this might help: https://ubuntuforums.org/showthread.php?t=921609 Scroll to the last post with: gksudo gedit /etc/default/mouseemu line – Tom Raganowicz Oct 20 '16 at 14:22

4 Answers4

6
sudo nano /usr/share/X11/xorg.conf.d/50-synaptics.conf 

Under the section "Input Class" edit the options for TapButton so you have

Section "InputClass"

        Option          "TapButton1" "1"
        Option          "TapButton2" "3"
        Option          "TapButton3" "2"

This will enable right click and tap to click.

Zanna
  • 70,465
bashar
  • 186
  • I FINALLY got the computer back -- and this worked! Awesome!!! One question - because I was wrong about the key that is actually used on the Mac side. On the Mac side, the physical CTRL key (not the Mac/command) key is the one that performs the function of opening a link when paired with a mouse click. What would the setup be to make this happen in a Ubuntu computer with the Super and CTRL button's switched? That is, how do I do the same thing, but have the keyboard button FOR THIS FUNCTION ONLY be the Super key (which is set to the CTRL button)? – Rsync Feb 11 '17 at 21:22
  • 4
    Whait, what? How does this achieve mapping ctrl+click to right click exactly? – rien333 Sep 18 '18 at 20:35
4

Both given answers didn't work for me. What worked for me was:

synclient RightButtonAreaLeft=1

Put it in some file that is run at startup (e.g. .bash, .zsh)

Source: https://bugs.launchpad.net/ubuntu/+bug/861694

2

The solution with mouseemu from here (and referenced in the question) works well for me on Lubuntu 18.10, as follows:

  1. Install mouseemu and a dependency it does not list (which is a bug!):

    sudo apt install mouseemu makedev
    
  2. Start mouseemu with the right configuration to use:

    sudo mouseemu -right 29 272
    

    It may take up to 5 seconds until the change takes effect. After that, Ctrl + left-click should create a right-click.

Unfortunately, sometimes this stops working randomly after a few minutes. In such a case, this will repair it:

sudo killall -9 mouseemu
sudo mouseemu -right 29 272
tanius
  • 6,303
  • 1
  • 39
  • 49
  • Sadly, this technique cannot be used for Ctrl + tap on a touchscreen to create a right-click. Because touch events do not have keyboard scancodes (tested it as shown here), which mouseemu expects for its configuration. – tanius May 05 '19 at 20:27
1

On Mint, I had this section at the bottom of my my 50-synaptics.conf

# This option disables software buttons on Apple touchpads.
# This option is only interpreted by clickpads.
Section "InputClass"
        Identifier "Disable clickpad buttons on Apple touchpads"
        MatchProduct "Apple|bcm5974"
        MatchDriver "synaptics"
        Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"
EndSection

Commenting out the option worked for me.

#Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"

Seems a strange default!

Steven P
  • 111