<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Second mouse button under OSX?</title>
		<link>http://www.allegro.cc/forums/view/585368</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 19 May 2006 21:40:21 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>mouse_b &amp; 2 doesn&#39;t work.. Do I have to do something apart from install_mouse() in order to be able to use the second button?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (netcat)</author>
		<pubDate>Thu, 18 May 2006 23:31:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>As Allegro manual says, on some platforms you need to call <i>pollmouse</i> manually. you may try this as code as many times as possible:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">if</span> <span class="k2">(</span><a href="http://www.allegro.cc/manual/mouse_needs_poll" target="_blank"><span class="a">mouse_needs_poll</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span> <span class="c">//maybe not needed</span>
   <a href="http://www.allegro.cc/manual/poll_mouse" target="_blank"><span class="a">poll_mouse</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
perhaps clics have been taken but your program doesn&#39;t update them
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Maikol)</author>
		<pubDate>Fri, 19 May 2006 00:26:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nope, that didn&#39;t fix anything, unless I did something wrong.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (netcat)</author>
		<pubDate>Fri, 19 May 2006 00:40:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It may be a limitation of Allegro under OSX. What does install_mouse() return?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 19 May 2006 00:58:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Global variables containing the current mouse position and button state. Wherever possible these values will be updated asynchronously, but if mouse_needs_poll() returns TRUE, you must manually call poll_mouse() to update them with the current input state. The `mouse_x&#39; and `mouse_y&#39; positions are integers ranging from zero to the bottom right corner of the screen. The `mouse_z&#39; variable holds the current wheel position, when using an input driver that supports wheel mice. The `mouse_b&#39; variable is a bitfield indicating the state of each button: bit 0 is the left button, bit 1 the right, and bit 2 the middle button. Additional non standard mouse buttons might be available as higher bits in this variable.
</p></div></div><p>

Should it be mouse_b &amp; 1?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (BAF)</author>
		<pubDate>Fri, 19 May 2006 01:04:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>bit 0 = 1  (left/primary)<br />bit 1 = 2  (right/secondary)<br />bit 2 = 4  (middle)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Fri, 19 May 2006 01:48:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Have you tried with the test program? (On the I/O|Mouse menu) On my iBook with a 1 button mouse I can access the other buttons with ctrl+click and command+click, and if I plug a 3 button USB mouse in, I can use the buttons directly.</p><p>If it works with the test program, it must be your code. Post some code!</p><p>Otherwise, can you tell us your Allegro version, OSX version and what type of Mac it is (intel or PPC)</p><p>Cheers,</p><p>Peter<br />ps. You don&#39;t need poll_mouse on OSX.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Hull)</author>
		<pubDate>Fri, 19 May 2006 02:04:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
As Allegro manual says, on some platforms you need to call pollmouse manually.
</p></div></div><p>
It lies.</p><p>About the second button: it&#39;s possible that Allegro&#39;s mouse driver only looks atthe first physical mouse button and emulates the second and third buttons with Option+click and Command+click (or the other way around). Can you check if those combinations work as a second and third mouse button?<br />It&#39;s possible that there is an option in the config file that can be used to change this behavior, though I suspect it will only disable the emulation, not enable the detection of the second button.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Fri, 19 May 2006 02:11:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ctrl-Click works.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Otherwise, can you tell us your Allegro version, OSX version and what type of Mac it is (intel or PPC)
</p></div></div><p>

I have Allegro v. 4.2 and the latest version of OSX on an iBook G4 (obviously a PPC).</p><p>Now that I think about it, I believe I had a program where mouse_b &amp; 2 worked as it should, but I can&#39;t find it so I assume I deleted it for some reason.</p><p>Also, mouse_b &amp; 4 checks for left mouse button clicks and not middle as it should (I think?).</p><p>edit: the example file only worked with ctrl-click and option-click, too.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (netcat)</author>
		<pubDate>Fri, 19 May 2006 21:40:21 +0000</pubDate>
	</item>
</rss>
