<?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>Computer mice &#8211; Henry Poon&#039;s Blog</title>
	<atom:link href="https://blog.henrypoon.com/blog/tag/computer-mice/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.henrypoon.com</link>
	<description></description>
	<lastBuildDate>Sun, 02 Oct 2022 04:20:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">83044199</site>	<item>
		<title>Disabling Mouse Acceleration in Ubuntu</title>
		<link>https://blog.henrypoon.com/blog/2015/01/25/disabling-mouse-acceleration-in-ubuntu/</link>
					<comments>https://blog.henrypoon.com/blog/2015/01/25/disabling-mouse-acceleration-in-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sun, 25 Jan 2015 08:31:32 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[AWK]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Computer mice]]></category>
		<category><![CDATA[Computer mouse]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Counter-Strike]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Digital technology]]></category>
		<category><![CDATA[DirectInput]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mass]]></category>
		<category><![CDATA[mouse acceleration]]></category>
		<category><![CDATA[Plan]]></category>
		<category><![CDATA[Plug]]></category>
		<category><![CDATA[Programming languages]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://www.henrypoon.com/blog/?p=1955</guid>

					<description><![CDATA[I&#8217;ve been quite accustomed to disabling mouse acceleration on my Windows machine (thanks to playing massive amounts of Counter-Strike back in the day), but now that I&#8217;ve started to use Linux a bit more, I&#8217;ve found that disabling mouse acceleration was not as easy as in Windows. Script I&#8217;ve managed to produce a script to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I&#8217;ve been quite accustomed to disabling mouse acceleration on my Windows machine (thanks to playing massive amounts of Counter-Strike back in the day), but now that I&#8217;ve started to use Linux a bit more, I&#8217;ve found that disabling mouse acceleration was not as easy as in Windows.</p>



<h1 class="wp-block-heading">Script</h1>



<p class="wp-block-paragraph">I&#8217;ve managed to produce a script to disable mouse acceleration (works for me on Ubuntu 14.04).  However, this script needs to be run every time the computer boots because the settings don&#8217;t stay.  Here is the script:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#wait for the desktop to settle
sleep 5

#gets the hardware id's of all mice plugged into the system
hardwareIds=$(xinput | grep -i mouse | awk '{print substr($(NF-3),4)}')

#turn off mouse acceleration
for i in $hardwareIds
do
xinput set-prop ${i} 'Device Accel Profile' -1
xinput set-prop ${i} 'Device Accel Velocity Scaling' 1
done</code></pre>



<h1 class="wp-block-heading">Explanation</h1>



<p class="wp-block-paragraph">The script works by extracting the hardware id&#8217;s of the mice that are connected to the system and then applying properties to them that disable mouse acceleration for that device.  The extraction of the mouse hardware id&#8217;s are done with this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#gets the hardware id's of all mice plugged into the system
hardwareIds=$(xinput | grep -i mouse | awk '{print substr($(NF-3),4)}')</code></pre>



<p class="wp-block-paragraph">Calling xinput in the Terminal will list all the connected input devices, which is grepped (case insensitively) for the word &#8220;mouse&#8221;, which gives something like this on my machine:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>⎜ ↳ Logitech G500s Laser Gaming Mouse id=14 [slave pointer (2)]<br>⎜ ↳ Logitech G500s Laser Gaming Mouse id=15 [slave pointer (2)]</p></blockquote>



<p class="wp-block-paragraph">The call to awk extracts the hardware id&nbsp;from those two lines (14, 15 in the above case) and stores them in an array that is iterated through when setting the mouse properties.</p>



<h1 class="wp-block-heading">Reference</h1>



<p class="wp-block-paragraph">This is the website that showed me how to disable mouse acceleration to begin with:&nbsp;<a href="http://ubuntuforums.org/showthread.php?t=1734400" target="_blank" rel="noopener noreferrer">http://ubuntuforums.org/showthread.php?t=1734400</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2015/01/25/disabling-mouse-acceleration-in-ubuntu/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1955</post-id>	</item>
	</channel>
</rss>
