[kaffe] [patch] Add MouseEvent.getButton() &c

Benja Fallenstein b.fallenstein at gmx.de
Tue Jul 6 14:09:49 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

the attached patch adds the following Java 1.4 features to
java.awt.event.MouseEvent:

- - BUTTON1
- - BUTTON2
- - BUTTON3
- - NOBUTTON
- - getButton()
- - constructor that takes the button as an argument

These changes in 1.4 allow the programmer to directly ask for the button
that the event is about, rather than having to figure it out from the
modifier mask (which also seems to be ambiguous because in Sun's Java,
the ALT mask is equal to the BUTTON2 mask and the META mask is equal to
the BUTTON3 mask, if I understand the Javadoc for MouseEvent correctly).

The patch only affects MouseEvent; I have not changed the classes
creating mouse events to use the new constructor that takes the button
as an argument, instead making the old constructor do the work of
figuring out which button it is from the modifiers list (with the
possible ambiguity).

Cheers,
- - Benja
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA6xUcUvR5J6wSKPMRAl9jAKDNCjWpOyZVNt7o/HNMppjDF2LurgCfWboE
GVH9ZgX08ZH/ih3mmr52E2w=
=IFn9
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mouseevent.patch
Type: text/x-patch
Size: 1687 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20040706/f1128330/attachment-0002.bin 


More information about the kaffe mailing list