Emulate keyTyped for OpenGL sketches

This commit is contained in:
Jakub Valtar
2015-08-17 19:17:03 -04:00
parent 79a6dccd2f
commit 7137cd9701

View File

@@ -927,6 +927,19 @@ public class PSurfaceJOGL implements PSurface {
keyCode);
sketch.postEvent(ke);
if (!isPCodedKey(code) && !isHackyKey(code)) {
if (peAction == KeyEvent.PRESS) {
// Create key typed event
// TODO: combine dead keys with the following key
KeyEvent tke = new KeyEvent(nativeEvent, nativeEvent.getWhen(),
KeyEvent.TYPE, peModifiers,
keyChar,
0);
sketch.postEvent(tke);
}
}
}
private static boolean isPCodedKey(short code) {