Re: DisplayEvent not emulating central click

Bill:

If the issue is that when both buttons are pressed/released, there is no "MOUSE_RELEASED_CENTER" event, I can confirm this (Windows 2000, JRE 1.3.1). I hadn't paid much attention to this until I was working on the "HandlePickEvent" class for Python, where I found only RIGHT and LEFT_RELEASED Id's being returned.

I cannot, however, confirm your CTRL_MASK being set. I just ran some tests, and using event.getInputEvent().isControlDown() always returns 'false', for various combinations of left, right, center...unless I actually hold the CTRL button down while clicking.

I note in passing that the SwingUtilities.isMiddleMouseButton() does not return a 'true' if I press both buttons (on my 2-button mouse)...

tom


Bill Hibbard wrote:
Hi Andres,

I am CC'ing visad-list because I have verified the problem
you noted in your original message. I get a related problem
on my Windows NT system. In my case when I press the center
mouse button, the java.awt.event.AWTEvent, which is also an
InputEvent, has its InputEvent.CTRL_MASK bit set to indicate
that the CTRL key is pressed, even though it isn't.

The behavior you observe, with the coordinates displayed
but no movement, can also be explained by the AWTEvent
having incorrect bits for CTRL and/or SHIFT keys. This looks
like a Java / Windows bug. You might be able to work around
with appropriate calls to MouseHelper.setFunctionMap(). See
visad/examples/Test00.java for an example.

Good luck,
Bill


On Mon, 3 Feb 2003, ANDRES DAVID ACERO MONTOYA wrote:


Hello

We still can?t find the source of the problem. We have made the change again
to the old visad release and it worked (the emulation) but the new still
doesn?t.
All this without any change in the class that uses it. We are using a two
button mouse,
jdk 1.4.0 and Windows 2000. When we made a :

System.out.println(""+e);

in the displayChanged(DisplayEvent e)

and the output shows that is not detecting a simultaneous click but a
separate one (new release of visad).

Output:

DisplayEvent: Display=display0, Id=FRAME_DONE, X=0, Y=0, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_PRESSED, X=202, Y=240, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_PRESSED_RIGHT, X=202, Y=240,
remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_PRESSED, X=202, Y=240, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_PRESSED_LEFT, X=202, Y=240,
remoteId=0
DisplayEvent: Display=display0, Id=FRAME_DONE, X=0, Y=0, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_RELEASED, X=202, Y=240, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_RELEASED_LEFT, X=202, Y=240,
remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_RELEASED, X=202, Y=240, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_RELEASED_RIGHT, X=202, Y=240,
remoteId=0
DisplayEvent: Display=display0, Id=FRAME_DONE, X=0, Y=0, remoteId=0


Using a 3 button mouse and using the central button (and the new release
of visad)
the output is as follows:

DisplayEvent: Display=display0, Id=MOUSE_PRESSED, X=210, Y=248, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_PRESSED_CENTER, X=210, Y=248,
remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_RELEASED, X=210, Y=249, remoteId=0
DisplayEvent: Display=display0, Id=MOUSE_RELEASED_CENTER, X=210, Y=249,
remoteId=0
DisplayEvent: Display=display0, Id=FRAME_DONE, X=0, Y=0, remoteId=0


Another important detail is that when we use the two button mouse to
emulate the central click the values
of the domain set appear on the superior left corner of the display
(latitude and longitude)
but the event fired to the displayChanged is not the central click.


Thanks again,

Andres David Acero M.
Universidad Nacional de Colombia Medell?n
HidroSIGJava Programmer



Hi Andres,


We have changed the visad release recently. And when we did it the
emulation of the central button by pressing both buttons on the mouse
stopped working. It may be a driver problem or have you changed it
lately. If you haven?t would you be interested in the details of the
circunstances?

I just tried clicking the left and right buttons to
emulate the center button, with the latest release,
and it worked OK for me. Perhaps as you suggest you
have a driver problem.

Good luck,
Bill







--
Tom Whittaker (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center
Cooperative Institute for Meteorological Satellite Studies
Phone/VoiceMail: 608.262.2759