Elliotte Harold <email@hidden> wrote:
> I tried out the new Mouse class in Java 5 mentioned in John Zukowski's
> article:
>
> http://www-128.ibm.com/developerworks/library/j-tiger05245/?ca=dnt-621
>
> public class Mouse {
> public static void main(String args[]) {;
> System.out.println(java.awt.MouseInfo.getNumberOfButtons());
> }
> }
>
> Result:
>
> $ java5 Mouse
> 0
>
> I knew Macs were button-limited, but this is ridiculous. Anyone else see
> the same? Is this a bug or does MouseInfo start counting the number of
> buttons from zero or some such weird thing?
i think this is deliberate (if misguided). i can't remember where i read
it, but the rationale was something along the lines of "the user can swap
mouse at any time, so the number of mouse buttons isn't constant".
actually, google "getnumberofbuttons mac" returns this as its first match:
http://developer.apple.com/releasenotes/Java/Java50RN/2_ResolvedIssues/chapter_3_section_3.html
just because programs using this method are probably a bad idea doesn't
mean it shouldn't make an effort to return the *current* number. or "1".
i wonder if Apple raised a bug with Sun?
i wonder what the equivalent OpenGL function returns?
--
Elliott Hughes, http://www.jessies.org/~enh/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden