3 |
PEG gl_mouse_modifiers--mudyc: Fixing native mouse event binder |
PEG gl_mouse_modifiers--mudyc: Fixing native mouse event binder |
4 |
======================================================================== |
======================================================================== |
5 |
|
|
6 |
:Authors: Matti Katila |
:Authors: Matti Katila, Tuomas J. Lukka |
7 |
:Date-Created: 2003-08-01 |
:Date-Created: 2003-08-01 |
8 |
:Last-Modified: $Date$ |
:Last-Modified: $Date$ |
9 |
:Revision: $Revision$ |
:Revision: $Revision$ |
28 |
doesn't look for modifier keys('Control', 'Alt', 'Shift' or 'Meta'). |
doesn't look for modifier keys('Control', 'Alt', 'Shift' or 'Meta'). |
29 |
|
|
30 |
|
|
31 |
Changes |
Background |
32 |
======= |
========== |
33 |
|
|
34 |
The current OpenGL event code sends modifier keys on mouse button |
The current OpenGL event code sends modifier keys on mouse button |
35 |
events in a really strange way: |
events in a really strange way: |
49 |
where 'Control', 'Shift', 'Alt' and 'Meta' are |
where 'Control', 'Shift', 'Alt' and 'Meta' are |
50 |
noticed only when the modifier is pressed. |
noticed only when the modifier is pressed. |
51 |
|
|
52 |
|
Changes |
53 |
|
======= |
54 |
|
|
55 |
|
The problem is, it appears, in JDK: the constants |
56 |
|
InputEvent.BUTTON2_MASK and InputEvent.BUTTON3_MASK |
57 |
|
are aliased to Event.ALT_MASK and META_MASK, respectively!!! |
58 |
|
|
59 |
|
JDK 1.4 has some sort of workarounds but they make things |
60 |
|
even more difficult - the workings of the MouseEvent |
61 |
|
constructor are complicated, to say the least.. |
62 |
|
|
63 |
|
In view of this and the fact that we shouldn't have to pull |
64 |
|
in any AWT code for GL-using vob code, we propose that |
65 |
|
``org.nongnu.libvob.Binder`` should stop using the MouseEvent class. |
66 |
|
|
67 |
|
The Libvob AWT code should translate the AWT mouse events |
68 |
|
to the protocol we decide on. |
69 |
|
|
70 |
|
I suggest an event structure of our own:: |
71 |
|
|
72 |
|
public class VobMouseEvent { |
73 |
|
public final static int MOUSE_PRESSED; |
74 |
|
public final static int MOUSE_RELEASED; |
75 |
|
public final static int MOUSE_WHEEL; |
76 |
|
|
77 |
|
public final static int SHIFT_MASK; |
78 |
|
public final static int CONTROL_MASK; |
79 |
|
public final static int ALT_MASK; |
80 |
|
|
81 |
|
public int getType(); |
82 |
|
public int getX(); |
83 |
|
public int getY(); |
84 |
|
public int getWheelDelta(); |
85 |
|
public int getModifiers(); |
86 |
|
public int getButton(); |
87 |
|
} |
88 |
|
|
89 |
|
|