aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-04-13 19:04:13 +0000
committerSven Gothel <[email protected]>2009-04-13 19:04:13 +0000
commit541d7c1bcaeb2b53460fbed1707c7f494528dc19 (patch)
treeb487c02a0cd2926f8db9ca9de894f5911462dc56 /src
parentda57c2c820d1cad4365a6a24018a90f46eb29a5f (diff)
NEWT: mouse pressed fix
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1902 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Window.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/Window.java b/src/newt/classes/com/sun/javafx/newt/Window.java
index e47fa5361..8c6d92fe5 100755
--- a/src/newt/classes/com/sun/javafx/newt/Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/Window.java
@@ -422,9 +422,9 @@ public abstract class Window implements NativeWindow
}
private ArrayList mouseListeners = new ArrayList();
- private int lastMouseButton = 0;
- private long lastMousePressed = 0;
- private int lastMouseClickCount = 0;
+ private int mouseButtonPressed = 0; // current pressed mouse button number
+ private long lastMousePressed = 0; // last time when a mouse button was pressed
+ private int lastMouseClickCount = 0; // last mouse button click count
public static final int ClickTimeout = 300;
protected void sendMouseEvent(int eventType, int modifiers, int x, int y, int button) {
@@ -446,7 +446,7 @@ public abstract class Window implements NativeWindow
lastMouseClickCount=1;
}
lastMousePressed=when;
- lastMouseButton=button;
+ mouseButtonPressed=button;
e = new MouseEvent(true, eventType, this, when,
modifiers, x, y, lastMouseClickCount, button);
} else if(MouseEvent.EVENT_MOUSE_RELEASED==eventType) {
@@ -458,12 +458,12 @@ public abstract class Window implements NativeWindow
} else {
lastMouseClickCount=0;
lastMousePressed=0;
- lastMouseButton=0;
}
+ mouseButtonPressed=0;
} else if(MouseEvent.EVENT_MOUSE_MOVED==eventType) {
- if (lastMouseButton>0) {
+ if (mouseButtonPressed>0) {
e = new MouseEvent(true, MouseEvent.EVENT_MOUSE_DRAGGED, this, when,
- modifiers, x, y, 1, lastMouseButton);
+ modifiers, x, y, 1, mouseButtonPressed);
} else {
e = new MouseEvent(true, eventType, this, when,
modifiers, x, y, 0, button);