diff options
Diffstat (limited to 'src/classes/com/sun')
-rw-r--r-- | src/classes/com/sun/javafx/newt/KeyEvent.java | 2 | ||||
-rw-r--r-- | src/classes/com/sun/javafx/newt/MouseEvent.java | 4 | ||||
-rwxr-xr-x | src/classes/com/sun/javafx/newt/Window.java | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/classes/com/sun/javafx/newt/KeyEvent.java b/src/classes/com/sun/javafx/newt/KeyEvent.java index b2ab58cba..7e224dbad 100644 --- a/src/classes/com/sun/javafx/newt/KeyEvent.java +++ b/src/classes/com/sun/javafx/newt/KeyEvent.java @@ -53,7 +53,7 @@ public class KeyEvent extends InputEvent public String toString() { return "KeyEvent["+getEventTypeString(getEventType())+ - ", code "+keyCode+", char "+keyChar+", isActionKey "+isActionKey()+", "+super.toString()+"]"; + ", code "+keyCode+"(0x"+Integer.toHexString(keyCode)+"), char <"+keyChar+"> (0x"+Integer.toHexString((int)keyChar)+"), isActionKey "+isActionKey()+", "+super.toString()+"]"; } public static String getEventTypeString(int type) { diff --git a/src/classes/com/sun/javafx/newt/MouseEvent.java b/src/classes/com/sun/javafx/newt/MouseEvent.java index 47d2803c0..79e11b875 100644 --- a/src/classes/com/sun/javafx/newt/MouseEvent.java +++ b/src/classes/com/sun/javafx/newt/MouseEvent.java @@ -38,6 +38,10 @@ public class MouseEvent extends InputEvent 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; protected MouseEvent(boolean sysEvent, int eventType, Window source, long when, int modifiers, int x, int y, int clickCount, int button) { diff --git a/src/classes/com/sun/javafx/newt/Window.java b/src/classes/com/sun/javafx/newt/Window.java index 58f91be55..155eda8a3 100755 --- a/src/classes/com/sun/javafx/newt/Window.java +++ b/src/classes/com/sun/javafx/newt/Window.java @@ -369,13 +369,16 @@ public abstract class Window implements NativeWindow private long lastMousePressed = 0; private int lastMouseClickCount = 0; public static final int ClickTimeout = 300; - private boolean[] buttonStates = new boolean[3]; + private boolean[] buttonStates = new boolean[MouseEvent.BUTTON_NUMBER]; protected void sendMouseEvent(int eventType, int modifiers, int x, int y, int button) { if(DEBUG_MOUSE_EVENT) { System.out.println("sendMouseEvent: "+MouseEvent.getEventTypeString(eventType)+ ", mod "+modifiers+", pos "+x+"/"+y+", button "+button); } + if(button<0||button>MouseEvent.BUTTON_NUMBER) { + throw new RuntimeException("Invalid mouse button number" + button); + } long when = System.currentTimeMillis(); MouseEvent eClicked = null; MouseEvent e = null; |