<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>oh god, why'd it break‽ &#187; mx518</title>
	<atom:link href="http://yokohead.com/tag/mx518/feed/" rel="self" type="application/rss+xml" />
	<link>http://yokohead.com</link>
	<description>screwing around with technology</description>
	<lastBuildDate>Mon, 26 Jul 2010 18:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Logitech MX-518 with Gnome in Ubuntu 8.10</title>
		<link>http://yokohead.com/2009/02/logitech-mx-518-with-gnome-in-ubuntu-810/</link>
		<comments>http://yokohead.com/2009/02/logitech-mx-518-with-gnome-in-ubuntu-810/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 01:01:00 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[configure]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[logitech]]></category>
		<category><![CDATA[mx518]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[x]]></category>

		<guid isPermaLink="false">http://yokohead.com/?p=166</guid>
		<description><![CDATA[Not having my back/forward keys working in anything in Ubuntu was driving me nuts &#8211; in Windows I was absolutely dependent on being able to lazily click the side buttons (even though I use mouse gestures).  The first thing I stumbled across seemed simple enough.
hyperq just replaced his InputDevice section with the code below, [...]]]></description>
			<content:encoded><![CDATA[<p>Not having my back/forward keys working in anything in Ubuntu was driving me nuts &#8211; in Windows I was absolutely dependent on being able to lazily click the side buttons (even though I use mouse gestures).  The first thing I <a href="http://ubuntuforums.org/showthread.php?t=664074&amp;highlight=mx518">stumbled across</a> seemed simple enough.</p>
<p>hyperq just replaced his <code>InputDevice</code> section with the code below,   when I checked my own xorg though I didn&#8217;t even have an <code>InputDevice</code> area at all &#8211; so I just pasted the following into the end of my <em>xorg.conf</em> and restarted X (ctrl+alt+backspace).</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; text-align: left;" dir="ltr">Section "InputDevice"
       Identifier      "Configured Mouse"
       Driver          "evdev"
       Option          "CorePointer"
       Option          "Buttons"       "7"
       Option          "ZAxisMapping"  "4 5"
       Option          "ButtonMapping" "1 2 3 6 7"
       Option          "Name"  "Logitech USB-PS/2 Optical Mouse"
EndSection</pre>
<p>Once X loaded up I was able to use the buttons in Firefox,  but that was about it.  Still didn&#8217;t work in Nautilus,  which is really where the functionality should be.</p>
<p>After a bit of hunting around I found this excellent <a href="http://ubuntuforums.org/showthread.php?t=219894&amp;highlight=logitech+how">UbuntuForum post</a> by <a href="http://ubuntuforums.org/member.php?u=45177">detyabozhye.</a></p>
<p>First step was to make sure that <em>xserver-xorg-input-evdev</em> was installed:</p>
<ul>
<li><code>locate evdev<br />
 </code></li>
</ul>
<p>Returned this for me:</p>
<p><a href="http://yokohead.com/wp-content/uploads/2009/02/screenshot-terminal.png"></a><a href="http://yokohead.com/wp-content/uploads/2009/02/screenshot-terminal1.png"><img class="alignnone size-thumbnail wp-image-178" title="screenshot-terminal1" src="http://yokohead.com/wp-content/uploads/2009/02/screenshot-terminal1-150x150.png" alt="screenshot-terminal1" width="150" height="150" /></a></p>
<p><em>xserver-xorg-input-evdev </em>is already installed,  no need to snag that particular package.  Next was checking my installed USB devices to see exactly what Ubuntu thinks my Logitech MX-518 actually is.</p>
<ul>
<li>c<code>at /proc/bus/input/devices</code></li>
</ul>
<p>The device list is quite extensive,  and I just pulled out the Logitech related bit</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; text-align: left;" dir="ltr">I: Bus=0003 Vendor=046d Product=c01e Version=0110
N: Name="<span style="color: #ff0000;"><strong>Logitech USB-PS/2 Optical Mouse</strong></span>"
P: Phys=usb-0000:00:0b.0-4/input0
S: Sysfs=/devices/pci0000:00/0000:00:0b.0/usb1/1-4/1-4:1.0/input/input4
U: Uniq=
H: Handlers=mouse1 event1
B: EV=17
B: KEY=ff0000 0 0 0 0
B: REL=103
B: MSC=10</pre>
<p>Perfect, this is the same thing I added into my xorg from earlier,  so it definitely has the right mouse,  and the Firefox back/forward buttons show this &#8211; but time to get it working with Nautilus.  Unfortunately there isn&#8217;t a native way to do this,  the buttons actually have to be bound to certain keys.</p>
<p>To do this there are two necessary packages,  <em>xvkbd</em> and <em>xbindkeys</em>.</p>
<ul>
<li><code>sudo apt-get install xvkbd xbindkeys</code></li>
</ul>
<p>Then <code>xbindkeys</code> needs to be configured to map the keys to Nautilus shortcuts.</p>
<ul>
<li><code>gedit ~/.xbindkeysrc</code></li>
</ul>
<p>Paste in the following:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; text-align: left;" dir="ltr">"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[<span style="text-decoration: underline;">L</span>eft]""
  m:0x0 + b:6
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[<span style="text-decoration: underline;">R</span>ight]""
  m:0x0 + b:7</pre>
<p>Hit<strong> CTRL+S </strong>to save,  then <strong>ALT+F4</strong> to close.</p>
<p>Started up <em>xbindkeys</em> and tested it in Nautilus &#8211; and nothing happened.  Made sure the key commands themselves worked by hitting <strong>ALT+LEFT </strong>and <strong>ALT+RIGHT</strong> &#8211; moved back and forward just like it should,  but my side buttons didn&#8217;t do it.  The only thing different from what detabozhye did and myself is I defined the buttons,  so I removed that part and matched deta&#8217;s suggestion,  then restarted X.  Firefox still worked, Nautilus didn&#8217;t.</p>
<p>This time I loaded <code>xev</code> to try and see what button was /actually/ being pressed since it obviously wasn&#8217;t 6 or 7 at this point.</p>
<ul>
<li><code>xev</code></li>
</ul>
<p>(That was easy, eh?)  Unfortunately <code>xev</code> is a pain in the arse to actually use.  What I had to do was click,   and hold the button to stop <code>xev</code> output from spamming my terminal and make very sure to not move the mouse (or more mouse movement spam would scroll by).</p>
<p>When I held down my large side button and scanned the output I saw this:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; text-align: left;" dir="ltr">ButtonPress event, serial 34, synthetic NO, window 0x4000001,
root 0x13b, subw 0x4000002, time 13076697, (36,18), root:(1014,814),
state 0x10, button 8, same_screen YES</pre>
<p>Finally,  it&#8217;s not 6,  it&#8217;s 8.  Great. The little upper one was 9.  Changed my .xbindkeysrc to update with the new buttons and then restarted <code>xbindkeys</code></p>
<ul>
<li><code>killall xbindkeys</code></li>
<li><code>xbindkeys</code></li>
</ul>
<p>Finally works.</p>
<p>Of course, after doing all of this I had a flash of insight&#8230; I <em>could&#8217;ve</em> simply had xev output to a file instead of trying to watch the terminal window and then searched for it later,   which I did as a test with a left click, then a right click, then a middle click.</p>
<ul>
<li><code>xev &gt; xevoutput.txt</code></li>
<li><em>left click, right click, then middle click</em> (in the xev window)</li>
<li><code>cat xevoutput.txt | grep button</code></li>
</ul>
<p>Returns:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; text-align: left;" dir="ltr">state 0x10, button 1, same_screen YES
state 0x110, button 1, same_screen YES
state 0x10, button 3, same_screen YES
state 0x410, button 3, same_screen YES
state 0x10, button 2, same_screen YES
state 0x210, button 2, same_screen YES</pre>
<p>There ya go&#8230; left click = 1,  right click = 3,  middle mouse click = 2.  If I did that earlier (and made life easier on myself) it would&#8217;ve returned 8 and 9 respectively.</p>
<p>Now this needs to be added to your startup list so it isn&#8217;t necessary to start it each time manually.  The easy way to do this in Gnome is by clicking <strong>System -&gt; Preferences -&gt; Session</strong>.  Click &#8220;Add&#8221;,  then type <code>xbindkeys</code> for the name,  and <code>xbindkeys</code> for the command,  and a description if you&#8217;d like.</p>
<p>I don&#8217;t like doing things through the GUI if I don&#8217;t have to,  so I hunted around for a way to configure it manually (mainly because I spent half my time SSH&#8217;d into the box from work and would rather have the way to work with or without a mouse).  After all of the above though I decided I&#8217;m done screwing around with this nonsense for the day and will make that into another post later tonight.</p>
]]></content:encoded>
			<wfw:commentRss>http://yokohead.com/2009/02/logitech-mx-518-with-gnome-in-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
