aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/com/jogamp/newt/event/KeyEvent.java61
-rw-r--r--src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java12
-rw-r--r--src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java4
3 files changed, 30 insertions, 47 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 45bccf964..6e63ad3a3 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -327,7 +327,6 @@ public class KeyEvent extends InputEvent
( nonPrintableKeys[3].min <= uniChar && uniChar <= nonPrintableKeys[3].max ) ) {
return false;
}
-
} else {
if( ( nonPrintableKeys[0].inclKeyChar && nonPrintableKeys[0].min <= uniChar && uniChar <= nonPrintableKeys[0].max ) ||
( nonPrintableKeys[1].inclKeyChar && nonPrintableKeys[1].min <= uniChar && uniChar <= nonPrintableKeys[1].max ) ||
@@ -391,12 +390,14 @@ public class KeyEvent extends InputEvent
this.max = max;
this.inclKeyChar = inclKeyChar;
}
- };
- /** Non printable key ranges, currently fixed to an aray of size 4. */
- public final static NonPrintableRange[] nonPrintableKeys = { new NonPrintableRange( (short)0x0000, (short)0x001F, true ),
- new NonPrintableRange( (short)0x0061, (short)0x0078, false),
- new NonPrintableRange( (short)0x007F, (short)0x009F, true ),
- new NonPrintableRange( (short)0xE000, (short)0xF8FF, true ) };
+ };
+ /** Non printable key ranges, currently fixed to an array of size 4. */
+ public final static NonPrintableRange[] nonPrintableKeys = {
+ new NonPrintableRange( (short)0x0000, (short)0x001F, true ), // Unicode: Non printable controls: [0x00 - 0x1F]
+ new NonPrintableRange( (short)0x0061, (short)0x0078, false), // Small 'a' thru 'z' (0x61 - 0x7a) - Not used for keyCode / keySym - Re-used for Fn (collision)
+ new NonPrintableRange( (short)0x008F, (short)0x009F, true ), // Unicode: Non printable controls: [0x7F - 0x9F], Numpad keys [0x7F - 0x8E] are printable!
+ new NonPrintableRange( (short)0xE000, (short)0xF8FF, true ) // Unicode: Private 0xE000 - 0xF8FF (Marked Non-Printable)
+ };
//
// Unicode: Non printable controls: [0x00 - 0x1F]
@@ -657,7 +658,7 @@ public class KeyEvent extends InputEvent
/** Constant for the "`" key */
public static final short VK_BACK_QUOTE = (short) 0x60;
- /** Small UTF/ASCII 'a' thru 'z' (0x61 - 0x7a) - Not used for keyCode / keySym. */
+ /** Small UTF/ASCII 'a' thru 'z' (0x61 - 0x7a) - Not used for keyCode / keySym. */
/**
* Constant for the F<i>n</i> function keys.
@@ -754,9 +755,11 @@ public class KeyEvent extends InputEvent
//
// Unicode: Non printable controls: [0x7F - 0x9F]
//
+ // Numpad keys [0x7F - 0x8E] are printable
+ //
- /** Constant for the DEL key, matching ASCII. Non printable UTF control. */
- public static final short VK_DELETE = (short) 0x7F;
+ /** Numeric keypad <b>decimal separator</b> key. Non printable UTF control. */
+ public static final short VK_SEPARATOR = (short) 0x7F;
/** Numeric keypad VK_NUMPAD0 thru VK_NUMPAD9 are mapped to UTF control (0x80 - 0x89). Non printable UTF control. */
public static final short VK_NUMPAD0 = (short) 0x80;
@@ -782,49 +785,37 @@ public class KeyEvent extends InputEvent
/** Numeric keypad <b>decimal separator</b> key. Non printable UTF control. */
public static final short VK_DECIMAL = (short) 0x8A;
- /** Numeric keypad <b>decimal separator</b> key. Non printable UTF control. */
- public static final short VK_SEPARATOR = (short) 0x8B;
-
/** Numeric keypad <b>add</b> key. Non printable UTF control. */
- public static final short VK_ADD = (short) 0x8C;
+ public static final short VK_ADD = (short) 0x8B;
/** Numeric keypad <b>subtract</b> key. Non printable UTF control. */
- public static final short VK_SUBTRACT = (short) 0x8D;
+ public static final short VK_SUBTRACT = (short) 0x8C;
/** Numeric keypad <b>multiply</b> key. Non printable UTF control. */
- public static final short VK_MULTIPLY = (short) 0x8E;
+ public static final short VK_MULTIPLY = (short) 0x8D;
/** Numeric keypad <b>divide</b> key. Non printable UTF control. */
- public static final short VK_DIVIDE = (short) 0x8F;
+ public static final short VK_DIVIDE = (short) 0x8E;
- /** Numeric keypad <b>num lock</b> key. Non printable UTF control. */
- public static final short VK_NUM_LOCK = (short) 0x90;
+ /** Constant for the DEL key, matching ASCII. Non printable UTF control. */
+ public static final short VK_DELETE = (short) 0x93;
- /** Numeric keypad <b>left</b> arrow key, for cursor pad see {@link #VK_LEFT}. Non printable UTF control. */
- public static final short VK_KP_LEFT = (short) 0x91;
-
- /** Numeric keypad <b>up</b> arrow key, for cursor pad see {@link #VK_UP}. Non printable UTF control. */
- public static final short VK_KP_UP = (short) 0x92;
-
- /** Constant for the numeric keypad <b>right</b> arrow key, for cursor pad see {@link #VK_RIGHT}. Non printable UTF control. */
- public static final short VK_KP_RIGHT = (short) 0x93;
+ /** Numeric keypad <b>num lock</b> key. Non printable UTF control. */
+ public static final short VK_NUM_LOCK = (short) 0x94;
- /** Numeric keypad <b>down</b> arrow key, for cursor pad see {@link #VK_DOWN}. Non printable UTF control. */
- public static final short VK_KP_DOWN = (short) 0x94;
-
- /** Constant for the cursor-pad <b>left</b> arrow key, for numerical pad see {@link #VK_KP_LEFT}*/
+ /** Constant for the cursor- or numerical-pad <b>left</b> arrow key. Non printable UTF control. */
public static final short VK_LEFT = (short) 0x95;
- /** Constant for the cursor-pad <b>left</b> arrow key, for numerical pad see {@link #VK_KP_UP}.*/
+ /** Constant for the cursor- or numerical-pad <b>up</b> arrow key. Non printable UTF control. */
public static final short VK_UP = (short) 0x96;
- /** Constant for the cursor-pad <b>left</b> arrow key, for numerical pad see {@link #VK_KP_RIGHT}.*/
+ /** Constant for the cursor- or numerical-pad <b>right</b> arrow key. Non printable UTF control. */
public static final short VK_RIGHT = (short) 0x97;
- /** Constant for the cursor-pad <b>left</b> arrow key, for numerical pad see {@link #VK_KP_DOWN}.*/
+ /** Constant for the cursor- or numerical pad <b>down</b> arrow key. Non printable UTF control. */
public static final short VK_DOWN = (short) 0x98;
- /** Constant for the Context Menu key. */
+ /** Constant for the Context Menu key. Non printable UTF control. */
public static final short VK_CONTEXT_MENU = (short) 0x99;
/**
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index ccbdc07bf..a1aa69e0a 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -369,13 +369,13 @@ public class AWTNewtEventFactory {
case java.awt.event.KeyEvent.VK_MULTIPLY : return com.jogamp.newt.event.KeyEvent.VK_MULTIPLY;
case java.awt.event.KeyEvent.VK_DIVIDE : return com.jogamp.newt.event.KeyEvent.VK_DIVIDE;
case java.awt.event.KeyEvent.VK_NUM_LOCK : return com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK;
- case java.awt.event.KeyEvent.VK_KP_LEFT : return com.jogamp.newt.event.KeyEvent.VK_KP_LEFT;
- case java.awt.event.KeyEvent.VK_KP_UP : return com.jogamp.newt.event.KeyEvent.VK_KP_UP;
- case java.awt.event.KeyEvent.VK_KP_RIGHT : return com.jogamp.newt.event.KeyEvent.VK_KP_RIGHT;
- case java.awt.event.KeyEvent.VK_KP_DOWN : return com.jogamp.newt.event.KeyEvent.VK_KP_DOWN;
+ case java.awt.event.KeyEvent.VK_KP_LEFT : /** Fall through intended .. */
case java.awt.event.KeyEvent.VK_LEFT : return com.jogamp.newt.event.KeyEvent.VK_LEFT;
+ case java.awt.event.KeyEvent.VK_KP_UP : /** Fall through intended .. */
case java.awt.event.KeyEvent.VK_UP : return com.jogamp.newt.event.KeyEvent.VK_UP;
+ case java.awt.event.KeyEvent.VK_KP_RIGHT : /** Fall through intended .. */
case java.awt.event.KeyEvent.VK_RIGHT : return com.jogamp.newt.event.KeyEvent.VK_RIGHT;
+ case java.awt.event.KeyEvent.VK_KP_DOWN : /** Fall through intended .. */
case java.awt.event.KeyEvent.VK_DOWN : return com.jogamp.newt.event.KeyEvent.VK_DOWN;
case java.awt.event.KeyEvent.VK_CONTEXT_MENU : return com.jogamp.newt.event.KeyEvent.VK_CONTEXT_MENU;
case java.awt.event.KeyEvent.VK_WINDOWS : return com.jogamp.newt.event.KeyEvent.VK_WINDOWS;
@@ -550,10 +550,6 @@ public class AWTNewtEventFactory {
case com.jogamp.newt.event.KeyEvent.VK_MULTIPLY : return java.awt.event.KeyEvent.VK_MULTIPLY;
case com.jogamp.newt.event.KeyEvent.VK_DIVIDE : return java.awt.event.KeyEvent.VK_DIVIDE;
case com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK : return java.awt.event.KeyEvent.VK_NUM_LOCK;
- case com.jogamp.newt.event.KeyEvent.VK_KP_LEFT : return java.awt.event.KeyEvent.VK_KP_LEFT;
- case com.jogamp.newt.event.KeyEvent.VK_KP_UP : return java.awt.event.KeyEvent.VK_KP_UP;
- case com.jogamp.newt.event.KeyEvent.VK_KP_RIGHT : return java.awt.event.KeyEvent.VK_KP_RIGHT;
- case com.jogamp.newt.event.KeyEvent.VK_KP_DOWN : return java.awt.event.KeyEvent.VK_KP_DOWN;
case com.jogamp.newt.event.KeyEvent.VK_LEFT : return java.awt.event.KeyEvent.VK_LEFT;
case com.jogamp.newt.event.KeyEvent.VK_UP : return java.awt.event.KeyEvent.VK_UP;
case com.jogamp.newt.event.KeyEvent.VK_RIGHT : return java.awt.event.KeyEvent.VK_RIGHT;
diff --git a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
index 5e240636d..24a5c41de 100644
--- a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
@@ -189,13 +189,9 @@ public class SWTNewtEventFactory {
case com.jogamp.newt.event.KeyEvent.VK_MULTIPLY : return SWT.KEYPAD_MULTIPLY;
case com.jogamp.newt.event.KeyEvent.VK_DIVIDE : return SWT.KEYPAD_DIVIDE;
case com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK : return SWT.NUM_LOCK;
- case com.jogamp.newt.event.KeyEvent.VK_KP_LEFT :
case com.jogamp.newt.event.KeyEvent.VK_LEFT : return SWT.ARROW_LEFT;
- case com.jogamp.newt.event.KeyEvent.VK_KP_UP :
case com.jogamp.newt.event.KeyEvent.VK_UP : return SWT.ARROW_UP;
- case com.jogamp.newt.event.KeyEvent.VK_KP_RIGHT :
case com.jogamp.newt.event.KeyEvent.VK_RIGHT : return SWT.ARROW_RIGHT;
- case com.jogamp.newt.event.KeyEvent.VK_KP_DOWN :
case com.jogamp.newt.event.KeyEvent.VK_DOWN : return SWT.ARROW_DOWN;
case com.jogamp.newt.event.KeyEvent.VK_HELP : return SWT.HELP;
}