<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>set_mouse_speed</title>
		<link>http://www.allegro.cc/forums/view/590690</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 25 Mar 2007 22:36:11 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There&#39;s plenty of topics out on the forums that I&#39;ve glanced at about the above function.  Here&#39;s what I&#39;ve got happens so far when using the set_mouse_speed function in the following settings (I&#39;d appreciate anyone who could fill in the &#39;?&#39;s):</p><p>Windows - Windowed Mode:  No affect<br />Windows - Fullscreen Mode:  Works (passing larger values to the function makes mouse move slower)<br />Linux - Windowed Mode:  ??<br />Linux - Fullscreen Mode:  ??<br />Mac - Windowed Mode:  ??<br />Mac - Fullscreen Mode:  ??</p><p>[EDIT]<br />I guess I&#39;m just going to forget about set_mouse_speed and write my own function to change how fast the mouse moves.  I can&#39;t seem to get this to work with the hardware cursor, so I&#39;m just drawing my own mouse sprite, which means it could lag on slower computers.  Here&#39;s the basic code of what I&#39;m doing to change how fast the mouse is moving, in case I&#39;m doing something evil:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="c">//In a logic function</span></td></tr><tr><td class="number">2</td><td><span class="k1">int</span> x, y<span class="k2">;</span></td></tr><tr><td class="number">3</td><td>  </td></tr><tr><td class="number">4</td><td><a href="http://www.allegro.cc/manual/get_mouse_mickeys" target="_blank"><span class="a">get_mouse_mickeys</span></a><span class="k2">(</span><span class="k3">&amp;</span>x, <span class="k3">&amp;</span>y<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">5</td><td><span class="k1">if</span><span class="k2">(</span>x <span class="k3">!</span><span class="k3">=</span> <span class="n">0</span> <span class="k3">|</span><span class="k3">|</span> y <span class="k3">!</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span></td></tr><tr><td class="number">6</td><td><span class="k2">{</span></td></tr><tr><td class="number">7</td><td>      <span class="c">//gmx, gmy are global float variables storing the position</span></td></tr><tr><td class="number">8</td><td>      <span class="c">//of the adjusted mouse position</span></td></tr><tr><td class="number">9</td><td>      <span class="c">//ACC is the adjustment factor</span></td></tr><tr><td class="number">10</td><td>  gmx <span class="k3">+</span><span class="k3">=</span> x <span class="k3">*</span> ACC<span class="k2">;</span></td></tr><tr><td class="number">11</td><td>  gmy <span class="k3">+</span><span class="k3">=</span> y <span class="k3">*</span> ACC<span class="k2">;</span></td></tr><tr><td class="number">12</td><td>&#160;</td></tr><tr><td class="number">13</td><td>  <a href="http://www.allegro.cc/manual/position_mouse" target="_blank"><span class="a">position_mouse</span></a><span class="k2">(</span>gmx, gmy<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td><span class="k2">}</span></td></tr><tr><td class="number">15</td><td><span class="c">//...</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td><span class="c">//In the final portion of the drawing function</span></td></tr><tr><td class="number">18</td><td><a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/mouse_sprite" target="_blank"><span class="a">mouse_sprite</span></a>, gmx, gmy<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td><a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, screen-&gt;w, screen-&gt;h<span class="k2">)</span><span class="k2">;</span>  </td></tr><tr><td class="number">20</td><td><span class="c">//...</span></td></tr></tbody></table></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Sun, 25 Mar 2007 00:02:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For linux (X11), set_mouse_speed() is implemented in 4.2.2 (SVN). Does nothing in 4.2.1 I think.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Milan Mimica)</author>
		<pubDate>Sun, 25 Mar 2007 22:36:11 +0000</pubDate>
	</item>
</rss>
