[4890] in java-interest

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

Re: Mouse evetns problem

daemon@ATHENA.MIT.EDU (Amy Fowler)
Thu Jan 18 14:55:06 1996

Date: Thu, 18 Jan 1996 07:52:27 -0800
From: Amy.Fowler@Eng.Sun.COM (Amy Fowler)
To: Amy.Fowler@Eng.Sun.COM, gil.bregman@applicom.co.il
Cc: java-interest@java.Eng.Sun.COM


>>> I just found out (from Sami) that the mouse buttons were mapped
>>> this way intentionally to support the multiple platforms (which
>>> don't necessarily have 3 mouse buttons):
>>> 
>>> 	left = mouse
>>> 	middle = ALT+mouse
>>> 	right = CTRL+mouse

>>
>>I think you got it wrong. Looking at awt/Event.java I see:
>>
>>public static final int CTRL_MASK           = 1 << 1;
>>public static final int META_MASK           = 1 << 2;
>>public static final int ALT_MASK            = 1 << 3;

Sorry, the "CTRL" was a mindless type-o.  You are right -- it's 
META for the right button.

>>
>>So, it's true that the middle button is equivalent to ALT+mouse (which is 
>>confusing because on Sun keyboards, you use the diamond key, the META 
>>one, as the alt). But, the right button is not CTRL+mouse, it's 
>>META+mouse.
>>
>>BTW, speaking of system dependecies, I don't think the distiction between 
>>ALT and META is valid on all the machines. Most keybaords have only the 
>>Alt key, and like I said before, Sun switched the Alt and Meta keys.

Yes, I wasn't suggesting that the current implementation is
the ideal solution; just trying to explain the reasoning
behind why it was setup that way since it isn't indicated 
anywhere in docs or source.

In general, dealing with different input devices is one of
the painful challenges in doing a multi-platform toolkit.

If you have any ideas of what mapping might make a better
multi-platform solution, I'd be glad to hear your suggestions.

Regards,
Amy Moore-Fowler
Java Products Group
Sun Microsystems, Inc.
-
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