aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
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/newt/classes/com/jogamp
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/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/event/InputEvent.java28
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MouseEvent.java11
2 files changed, 26 insertions, 13 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;