Look at my page again with regards to the mouse behaviors.  I did remap the buttons.

http://www.sigda.org/Eric/java3d/behaviors/index.htm

If you compare each of my mouse behaviors with sun's original, you will see that it is just a matter of changing the "!" in front of the mouse modifier conditions.


At the top of my MouseRotate.java source, you will see a commented out area like this:


<               id = event[i].getID();
<               if ((id == MouseEvent.MOUSE_DRAGGED) &&
<                   !((MouseEvent)event[i]).isMetaDown() &&
<                   !((MouseEvent)event[i]).isAltDown()){

>               id = event[i].getID();
>               if ((id == MouseEvent.MOUSE_DRAGGED) &&
>                   ((MouseEvent)event[i]).isMetaDown() &&
>                   !((MouseEvent)event[i]).isAltDown()){

The top is Sun's original code.  Mine is the bottom.
Sun's says for a MouseRotate, if the mouse is dragged and neither modifier is down (meaning the middle or right mouse buttons or a combination of the left mouse button and a keyboard modifier) then rotate.

I changed it to be the right mouse button (Right for rotate).  My code says for a MouseRotate, if the mouse is dragged and the right mouse button is depressed (Meta is down) but not the middle button (Alt down), then do a rotate.

You can also use a combination of the keyboard equivalents of the modifier keys and the left mouse button.  ( This is for those handicapped Mac people with only one mouse button.)

On a PC the Alt button on the keyboard works for the Alt modifier but there is no Meta equivalent.

SO there are actually four possible ways to distinguish a mouse button.

A mouse press using the left button  = no modifier down
A mouse press using the middle button = Alt modifier down = (Also the same as holding the Alt key on the keyboard while depressing the left mouse button)

A mouse press using the right button = Meta modifier down = (No equivalent keyboard + mouse button on a PC)

A mouse press using the right and middle buttons = Meta and Alt modifier down =  (Also the same as holding the Alt key on the keyboard while depressing the right mouse button)

The last possibility is not very likely to be used but it is possible and I use it.

By looking at the top of my mouse behaviors and knowing that Sun originally meant for modifiers to be:

Left mouse button = rotate
Right mouse button = Translate
Middle mouse button = zoom

With my remapping to:
Left mouse button = none (does something else)
Right mouse button = Rotate (right for rotate)
Middle mouse button = Translate (middle for move)  ( I call it move to help remember)
Right and Middle mouse button = Zoom


I use a left click for just selecting an object or for double clicking on it to bring up a properties dialog box.  But this is unique to my application.

Just look at my source, change it to meet your needs and recompile.

Hope this helps.

Glad to hear the behaviors are working for you.



At 08:58 PM 12/20/1995 +0100, you wrote:
Hello,
 
Finally the behaviors of eric works perfectly but now I have another problem.
 
I put two behaviors MouseTranslate and MouseRotate, but both work in the right button of the mouse..
 
My question is how I can put MouseRotate in the left button and MouseTranslate in the right button.
 
Thanks.
 
PD Eric your behaviors are very good.Thanks

***********************************************************************
Eric Reiss - http://www.sigda.acm.org/Eric/
Email: [EMAIL PROTECTED]

SIGDA Internet Server Manager - http://www.sigda.acm.org/

Assistant Systems Manager - School of Engineering
University of Pittsburgh
***********************************************************************

Reply via email to