Merge pull request #3719 from JakubValtar/fx-esc

FX - fix AIOOBE when pressing ESC on Mac
This commit is contained in:
Ben Fry
2015-08-25 22:32:25 -04:00
+3 -1
View File
@@ -733,7 +733,9 @@ public class PSurfaceFX implements PSurface {
@SuppressWarnings("deprecation")
private char getKeyChar(KeyEvent fxEvent) {
if (fxEvent.getEventType() == KeyEvent.KEY_TYPED) {
return fxEvent.getCharacter().charAt(0);
String ch = fxEvent.getCharacter();
if (ch.length() < 1) return PConstants.CODED;
return ch.charAt(0);
}
KeyCode kc = fxEvent.getCode();