aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MouseEvent.java197
1 files changed, 99 insertions, 98 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index cb2138b8f..68378fbca 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -36,91 +36,89 @@ package com.jogamp.newt.event;
public class MouseEvent extends InputEvent
{
- /** Mouse button 1 name. Button names start with 1. */
- public static final int BUTTON1 = 1;
- public static final int BUTTON2 = 2;
- public static final int BUTTON3 = 3;
- public static final int BUTTON4 = 4;
- public static final int BUTTON5 = 5;
- public static final int BUTTON6 = 6;
- /** Maximal number of supported mouse buttons. */
- public static final int BUTTON_NUMBER = 6;
-
- /** Pointer device 1 name. Pointer names start with 0. */
- public static final int POINTER1 = 0;
- public static final int POINTER2 = 1;
- public static final int POINTER3 = 2;
- /** Maximal number of supported pointer devices. */
- public static final int POINTER_NUMBER = 3;
-
- public static final int getClickTimeout() {
- return 300;
- }
-
- public MouseEvent(int eventType, Object source, long when,
- int modifiers, int x, int y, int clickCount, int button,
- int rotation)
- {
- super(eventType, source, when, modifiers);
-
- this.pointerCount=1;
- this.x=new int[1]; this.x[0] = x;
- this.y=new int[1]; this.y[0] = y;
- this.button=new int[1]; this.button[0] = button;
- this.clickCount=clickCount;
- this.wheelRotation = rotation;
- }
-
- public MouseEvent(int eventType, Object source, long when,
- int modifiers, int pointerCount, int[] x, int[] y, int[] button, int[] pressure,
- int clickCount, int rotation)
- {
- super(eventType, source, when, modifiers);
- this.pointerCount=pointerCount;
- this.x=x;
- this.y=y;
- this.button=button;
- this.clickCount=clickCount;
- this.wheelRotation = rotation;
- }
-
- public int getPointerCount() {
- return pointerCount;
- }
- public int getButton() {
- return button[0];
- }
- public int getX() {
- return x[0];
- }
- public int getY() {
- return y[0];
- }
- public int getButton(int pointerIdx) {
- return button[pointerIdx];
- }
- public int getX(int pointerIdx) {
- return x[pointerIdx];
- }
- public int getY(int pointerIdx) {
- return y[pointerIdx];
- }
- public int getClickCount() {
- return clickCount;
- }
- public int getWheelRotation() {
- return wheelRotation;
- }
-
- public String toString() {
- return "MouseEvent["+getEventTypeString(getEventType())+
- ", "+x+"/"+y+", button "+button+", count "+clickCount+
- ", wheel rotation "+wheelRotation+
- ", "+super.toString()+"]";
- }
-
- public static String getEventTypeString(int type) {
- switch(type) {
+ public static final int BUTTON1 = 1;
+ public static final int BUTTON2 = 2;
+ public static final int BUTTON3 = 3;
+ public static final int BUTTON4 = 4;
+ public static final int BUTTON5 = 5;
+ public static final int BUTTON6 = 6;
+ public static final int BUTTON_NUMBER = 6;
+
+ public static final int getClickTimeout() {
+ return 300;
+ }
+
+ public MouseEvent(int eventType, Object source, long when,
+ int modifiers, int x, int y, int clickCount, int button,
+ int rotation)
+ {
+ super(eventType, source, when, modifiers);
+ this.x = new int[1];
+ this.y = new int[1];
+
+ this.x[0]=x;
+ this.y[0]=y;
+
+ this.clickCount=clickCount;
+ this.button=button;
+ this.wheelRotation = rotation;
+ }
+
+ public MouseEvent(int eventType, Object source, long when,
+ int modifiers, int[] x, int[] y, int clickCount, int button,
+ int rotation)
+ {
+ super(eventType, source, when, modifiers);
+ this.x = x;
+ this.y = y;
+
+ this.clickCount=clickCount;
+ this.button=button;
+ this.wheelRotation = rotation;
+ }
+
+ public int getPointerCount() {
+ return x.length;
+ }
+
+ public int getPointerID() {
+ return x.length;
+ }
+
+ public int getButton() {
+ return button;
+ }
+ public int getClickCount() {
+ return clickCount;
+ }
+ public int getX() {
+ return x[0];
+ }
+ public int getY() {
+ return y[0];
+ }
+
+ public int getX(int pointer) {
+ return x[pointer];
+ }
+
+ public int getY(int pointer) {
+ return y[pointer];
+ }
+
+ public int getWheelRotation() {
+ return wheelRotation;
+ }
+
+ public String toString() {
+ return "MouseEvent["+getEventTypeString(getEventType())+
+ ", "+x+"/"+y+", button "+button+", count "+clickCount+
+ ", wheel rotation "+wheelRotation+
+ ", "+super.toString()+"]";
+ }
+
+ public static String getEventTypeString(int type) {
+ switch(type) {
case EVENT_MOUSE_CLICKED: return "EVENT_MOUSE_CLICKED";
case EVENT_MOUSE_ENTERED: return "EVENT_MOUSE_ENTERED";
case EVENT_MOUSE_EXITED: return "EVENT_MOUSE_EXITED";
@@ -129,19 +127,22 @@ public class MouseEvent extends InputEvent
case EVENT_MOUSE_MOVED: return "EVENT_MOUSE_MOVED";
case EVENT_MOUSE_DRAGGED: return "EVENT_MOUSE_DRAGGED";
case EVENT_MOUSE_WHEEL_MOVED: return "EVENT_MOUSE_WHEEL_MOVED";
+ case EVENT_MOUSE_PRESSED_MINOR: return "EVENT_MOUSE_PRESSED_MINOR";
+ case EVENT_MOUSE_RELEASED_MINOR: return "EVENT_MOUSE_RELEASED_MINOR";
default: return "unknown (" + type + ")";
+ }
}
- }
-
- private final int pointerCount, clickCount, wheelRotation;
- private final int x[], y[], button[];
-
- public static final int EVENT_MOUSE_CLICKED = 200;
- public static final int EVENT_MOUSE_ENTERED = 201;
- public static final int EVENT_MOUSE_EXITED = 202;
- public static final int EVENT_MOUSE_PRESSED = 203;
- public static final int EVENT_MOUSE_RELEASED = 204;
- public static final int EVENT_MOUSE_MOVED = 205;
- public static final int EVENT_MOUSE_DRAGGED = 206;
- public static final int EVENT_MOUSE_WHEEL_MOVED = 207;
+
+ private final int x[], y[], clickCount, button, wheelRotation;
+
+ public static final int EVENT_MOUSE_CLICKED = 200;
+ public static final int EVENT_MOUSE_ENTERED = 201;
+ public static final int EVENT_MOUSE_EXITED = 202;
+ public static final int EVENT_MOUSE_PRESSED = 203;
+ public static final int EVENT_MOUSE_RELEASED = 204;
+ public static final int EVENT_MOUSE_MOVED = 205;
+ public static final int EVENT_MOUSE_DRAGGED = 206;
+ public static final int EVENT_MOUSE_WHEEL_MOVED = 207;
+ public static final int EVENT_MOUSE_PRESSED_MINOR = 208;
+ public static final int EVENT_MOUSE_RELEASED_MINOR = 209;
}