summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-08 01:22:30 +0200
committerSven Gothel <[email protected]>2012-10-08 01:22:30 +0200
commitd10dae464ef9309a92eb9b49323fe1db93c3fc9f (patch)
treeb80bd2ef759066c7c23fb2e32b0941432ff5954f /src
parent630d43be7a8cccf28632fc1f7542bb484382d775 (diff)
Raise NEWT MouseButton Maximum from 6 -> 16 (API Change)
- Button 9 has been reported to be sent by Olamedia - Rearrange the input bit mask in InputEvent (API Change) - Raise the max. button number to 16
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/com/jogamp/newt/event/InputEvent.java28
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MouseEvent.java11
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java4
-rw-r--r--src/newt/native/InputEvent.h25
4 files changed, 43 insertions, 25 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index 148ac5962..0122bda9a 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -43,22 +43,28 @@ public abstract class InputEvent extends NEWTEvent
public static final int CTRL_MASK = 1 << 1;
public static final int META_MASK = 1 << 2;
public static final int ALT_MASK = 1 << 3;
- public static final int ALT_GRAPH_MASK = 1 << 5;
- public static final int BUTTON1_MASK = 1 << 6;
- public static final int BUTTON2_MASK = 1 << 7;
- public static final int BUTTON3_MASK = 1 << 8;
- public static final int BUTTON4_MASK = 1 << 9;
- public static final int BUTTON5_MASK = 1 << 10;
- public static final int BUTTON6_MASK = 1 << 11;
+ public static final int ALT_GRAPH_MASK = 1 << 4;
+
+ public static final int BUTTON1_MASK = 1 << 5;
+ public static final int BUTTON2_MASK = 1 << 6;
+ public static final int BUTTON3_MASK = 1 << 7;
+ public static final int BUTTON4_MASK = 1 << 8;
+ public static final int BUTTON5_MASK = 1 << 9;
+ public static final int BUTTON6_MASK = 1 << 10;
+ public static final int BUTTON7_MASK = 1 << 11;
+ public static final int BUTTON8_MASK = 1 << 12;
+ public static final int BUTTON9_MASK = 1 << 13;
+
+ public static final int BUTTONLAST_MASK = 1 << 20; // 16
/** Event is caused by auto-repeat. */
- public static final int AUTOREPEAT_MASK = 1 << 15;
+ public static final int AUTOREPEAT_MASK = 1 << 29;
/** Pointer is confined, see {@link Window#confinePointer(boolean)}. */
- public static final int CONFINED_MASK = 1 << 16;
+ public static final int CONFINED_MASK = 1 << 30;
/** Pointer is invisible, see {@link Window#setPointerVisible(boolean)}. */
- public static final int INVISIBLE_MASK = 1 << 17;
+ public static final int INVISIBLE_MASK = 1 << 31;
/**
* Returns the corresponding button mask for the given button.
@@ -70,7 +76,7 @@ public abstract class InputEvent extends NEWTEvent
*/
public static final int getButtonMask(int button) {
if( 0 < button && button <= MouseEvent.BUTTON_NUMBER ) {
- return 1 << ( 5 + button ) ;
+ return 1 << ( 4 + button ) ;
}
return 0;
}
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index d293d2db7..914aaa647 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -49,8 +49,15 @@ public class MouseEvent extends InputEvent
public static final int BUTTON5 = 5;
/** ID for button 6, value <code>6</code> */
public static final int BUTTON6 = 6;
- /** Number of buttons, value <code>6</code> */
- public static final int BUTTON_NUMBER = 6;
+ /** ID for button 6, value <code>7</code> */
+ public static final int BUTTON7 = 7;
+ /** ID for button 6, value <code>8</code> */
+ public static final int BUTTON8 = 8;
+ /** ID for button 6, value <code>9</code> */
+ public static final int BUTTON9 = 9;
+
+ /** Maximum number of buttons, value <code>16</code> */
+ public static final int BUTTON_NUMBER = 16;
public static final int getClickTimeout() {
return 300;
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 92f174e39..c21cb4b40 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -51,9 +51,9 @@ import com.jogamp.newt.event.MouseEvent;
public class WindowDriver extends WindowImpl {
private static final String WINDOW_CLASS_NAME = "NewtWindow";
- private static final int X11_WHEEL_ONE_UP_BUTTON = 4;
+ private static final int X11_WHEEL_ONE_UP_BUTTON = 4;
private static final int X11_WHEEL_ONE_DOWN_BUTTON = 5;
- private static final int X11_WHEEL_TWO_UP_BUTTON = 6;
+ private static final int X11_WHEEL_TWO_UP_BUTTON = 6;
private static final int X11_WHEEL_TWO_DOWN_BUTTON = 7;
static {
diff --git a/src/newt/native/InputEvent.h b/src/newt/native/InputEvent.h
index 51c56c474..3fa7dbefe 100644
--- a/src/newt/native/InputEvent.h
+++ b/src/newt/native/InputEvent.h
@@ -38,15 +38,20 @@
#define EVENT_CTRL_MASK (1 << 1)
#define EVENT_META_MASK (1 << 2)
#define EVENT_ALT_MASK (1 << 3)
-#define EVENT_ALT_GRAPH_MASK (1 << 5)
-#define EVENT_BUTTON1_MASK (1 << 6)
-#define EVENT_BUTTON2_MASK (1 << 7)
-#define EVENT_BUTTON3_MASK (1 << 8)
-#define EVENT_BUTTON4_MASK (1 << 9)
-#define EVENT_BUTTON5_MASK (1 << 10)
-#define EVENT_BUTTON6_MASK (1 << 11)
-#define EVENT_AUTOREPEAT_MASK (1 << 15)
-#define EVENT_CONFINED_MASK (1 << 16)
-#define EVENT_INVISIBLE_MASK (1 << 17)
+#define EVENT_ALT_GRAPH_MASK (1 << 4)
+
+#define EVENT_BUTTON1_MASK (1 << 5)
+#define EVENT_BUTTON2_MASK (1 << 6)
+#define EVENT_BUTTON3_MASK (1 << 7)
+#define EVENT_BUTTON4_MASK (1 << 8)
+#define EVENT_BUTTON5_MASK (1 << 9)
+#define EVENT_BUTTON6_MASK (1 << 10)
+#define EVENT_BUTTON7_MASK (1 << 11)
+#define EVENT_BUTTON8_MASK (1 << 12)
+#define EVENT_BUTTON9_MASK (1 << 13)
+
+#define EVENT_AUTOREPEAT_MASK (1 << 29)
+#define EVENT_CONFINED_MASK (1 << 30)
+#define EVENT_INVISIBLE_MASK (1 << 31)
#endif