[5180] in java-interest

home help back first fref pref prev next nref lref last post

Re: How can I distinguish which button was pressed?

daemon@ATHENA.MIT.EDU (Greg Ewing)
Wed Jan 31 14:42:01 1996

Date: Wed, 31 Jan 1996 11:02:42 +1100
From: grege@optimation.com.au (Greg Ewing)
To: java-interest@java.sun.com

> From NewsGroup_comp-lang-java Tue Jan 30 08:20 EST 1996
> From: NewsGroup_comp-lang-java
> >From: andrew@ssynth.co.uk (Andrew Gay)
> Subject: Re: How can I distinguish which button was pressed?
> Date: Fri, 26 Jan 1996 12:10:13 +0000
> Nntp-Posting-Host: domitian.ssynth.co.uk
> 
> In article <9601240045.AA02592@26132-news.thredbo.optimation.com.au>,
> grege@optimation.com.au (Greg Ewing) wrote:
> 
> > > switch@utopia.medison.co.kr (SeungWook Choi) wrote:
> > > 
> > > >In handling mouse events, how can I distinguish which mouse button
> > > >was pressed ?
> > > >mouseDown() seems to check whether mouse button is pressed or not.
> > > >Is there anybody who will let me know?
> > 
> > This is how I distinguish mouse button clicks:
> > 
> [java code for distinguishing which mouse button]
> > 
> > This works for Solaris (actually I haven't tested the middle button yet), 
> > however I seem to recall reading somewhere that Win95 may be slightly 
> > different (META_MASK instead of CTRL_MASK ??).
> 
> Hold on!  Java is supposed to be *cross-platform*, right?  Don't forget
> that the mouse on the Mac has only *one* button!  So anything you write
> which relies on there being more than one button will not work on the
> Mac (once a java port becomes available).
> 
> -- 
> Andrew Gay    http://www.ssynth.co.uk/~gay/
> Systems Synthesis Ltd, Bristol UK
> 

Not quite correct. The java API allows a mac user to simulate middle and 
right mouse clicks by holding down CTRL/META keys when mouse-clicking. The 
code will work on all platforms as long as the user knows how to simulate.

GREG

grege@optimation.com.au
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post