{"id":375,"date":"2009-06-11T22:29:57","date_gmt":"2009-06-11T19:29:57","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=375"},"modified":"2009-06-12T00:05:40","modified_gmt":"2009-06-11T21:05:40","slug":"handling-right-clicks-on-a-macbook-running-linux","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2009\/06\/11\/handling-right-clicks-on-a-macbook-running-linux\/","title":{"rendered":"Handling right clicks on a macbook running Linux"},"content":{"rendered":"<p>I&#8217;ve finally settled down to a solution that I am happy with. I used to have the following options inside my Xorg.conf:<br \/>\n<code>Section \"InputDevice\"<br \/>\n    Identifier      \"Synaptics Touchpad\"<br \/>\n    Driver          \"synaptics\"<br \/>\n[...snip...]<br \/>\n    Option          \"TapButton1\"            \"1\"<br \/>\n    Option          \"TapButton2\"            \"3\"<br \/>\n    Option          \"TapButton3\"            \"2\"<br \/>\n    Option          \"VertTwoFingerScroll\"   \"1\"<br \/>\n    Option          \"HorizTwoFingerScroll\"  \"1\"<br \/>\n[...snip...]<br \/>\n<\/code><\/p>\n<p>This works like this:<br \/>\ni) a single tap is a left click<br \/>\nii) a two-finger tap is a right click<br \/>\niii) a three-finger tap is a middle click<br \/>\nand you could scroll horizontally and vertically using two fingers on the touchpad, like Mac OS X.<br \/>\nThe problem with this setup is that I used to have a lot of accidental double tappings while scrolling with two fingers horizontally or vertically. This of course produced unwanted right clicks.<\/p>\n<p>I wanted a solution that I could get right click in somehow like Mac OS X does it, using ctrl+tap\/ctrl+click. I found a solution that emulated ctrl+click as a right click but then many applications started misbehaving. Firefox for example uses ctrl+click on Linux to open a link on a new tab, when I used ctrl+click as a right click, Firefox stopped opening the links. So I went to plan B. <\/p>\n<p><strong>CMD key(apple key)-click as a right click.<\/strong><\/p>\n<p>To achieve that:<br \/>\na) install <a href=\"http:\/\/homepage3.nifty.com\/tsato\/xvkbd\/\">xvkbd<\/a>.<br \/>\nDebian: apt-get install xvkbd<br \/>\nGentoo: emerge xvkbd<br \/>\nb) install <a href=\"http:\/\/hocwp.free.fr\/xbindkeys\/xbindkeys.html\">xbindkeys<\/a>.<br \/>\nDebian: apt-get install xbindkeys<br \/>\nGentoo: emerge xbindkeys<br \/>\nc) create the default .xbindkeysrc file: xbindkeys &#8211;defaults > ~\/.xbindkeysrc<br \/>\nd) edit it and put the following inside: <code>\"xvkbd -text '\\m3'\"<br \/>\n    mod4 + b:1   (mouse)<\/code><br \/>\ne) edit xorg.conf and set this:<code>    Option          \"TapButton2\"            \"0\"<\/code><br \/>\nThis effectively disables double tapping as a right click.<br \/>\nf) restart X<br \/>\ng) open a terminal and start xbindkeys from it: <code>$ xbindkeys -n -v<\/code><br \/>\nNow press CMD key and tap the touchpad or click the touchpad button. You should be greeted with a fresh right click!<\/p>\n<p>If all went well put xbindkeys in your DE&#8217;s autostart.<\/p>\n<p>The following works flawlessly on <a href=\"http:\/\/www.xfce.org\/\">XFCE<\/a>\/<a href=\"http:\/\/www.lxde.org\/\">LXDE<\/a>. CMD-click or CMD-tap opens XFCE&#8217;s menu or LXDE&#8217;s desktop menu.<\/p>\n<p>On <a href=\"http:\/\/fluxbox.org\">fluxbox<\/a> though there is still a problem. It&#8217;s very common for fluxbox key config to look something like the following:<br \/>\n<code>OnDesktop Mouse1 :hideMenus<br \/>\nOnDesktop Mouse2 :workspaceMenu<br \/>\nOnDesktop Mouse3 :rootMenu<br \/>\nOnDesktop Mouse4 :nextWorkspace<br \/>\nOnDesktop Mouse5 :prevWorkspace<br \/>\n<\/code><\/p>\n<p>So to open the RootMenu, which is the basic menu with the applications shortcuts for fluxbox, one needs to actually right click on the Desktop. That worked with <em>TabButton2=3<\/em> but it does not work right now. To get around that problem I binded the key left to (1\/!) which is normally the (\u00b1\/\u00a7) key on Macs to the Menu key using xmodmap.<br \/>\n<code> $ cat .xmodmap<br \/>\nkeycode 94 =  Menu<br \/>\n<\/code><br \/>\nI never used that key anyway&#8230;<\/p>\n<p>I&#8217;ve now got my precious right click back without accidental miss-clicks. yihaa!<\/p>\n<p>References: <a href=\"http:\/\/www.joshourisman.com\/2008\/04\/06\/freebsd-on-an-apple-macbook\/\">FreeBSD on an Apple MacBook<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve finally settled down to a solution that I am happy with. I used to have the following options inside my Xorg.conf: Section &#8220;InputDevice&#8221; Identifier &#8220;Synaptics Touchpad&#8221; Driver &#8220;synaptics&#8221; [&#8230;snip&#8230;] Option &#8220;TapButton1&#8221; &#8220;1&#8221; Option &#8220;TapButton2&#8221; &#8220;3&#8221; Option &#8220;TapButton3&#8221; &#8220;2&#8221; Option &#8220;VertTwoFingerScroll&#8221; &#8220;1&#8221; Option &#8220;HorizTwoFingerScroll&#8221; &#8220;1&#8221; [&#8230;snip&#8230;] This works like this: i) a single tap is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[12,3],"tags":[30,31,32,124,33,107,601,595,122,27,123,28,29,121],"class_list":["post-375","post","type-post","status-publish","format-standard","hentry","category-gentoo","category-linux","tag-accidental","tag-click","tag-ctrl-click","tag-ctrltap","tag-debian","tag-fluxbox","tag-gentoo","tag-linux","tag-lxde","tag-macbook","tag-right-click","tag-synaptic","tag-toucpad","tag-xfce"],"aioseo_notices":[],"views":36230,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":18,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":597,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/375\/revisions\/597"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}