Skip to content

Commit ea9a4c4

Browse files
committed
Emulate keyTyped for OpenGL sketches
1 parent 3395f07 commit ea9a4c4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

core/src/processing/opengl/PSurfaceJOGL.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,19 @@ protected void nativeKeyEvent(com.jogamp.newt.event.KeyEvent nativeEvent,
927927
keyCode);
928928

929929
sketch.postEvent(ke);
930+
931+
if (!isPCodedKey(code) && !isHackyKey(code)) {
932+
if (peAction == KeyEvent.PRESS) {
933+
// Create key typed event
934+
// TODO: combine dead keys with the following key
935+
KeyEvent tke = new KeyEvent(nativeEvent, nativeEvent.getWhen(),
936+
KeyEvent.TYPE, peModifiers,
937+
keyChar,
938+
0);
939+
940+
sketch.postEvent(tke);
941+
}
942+
}
930943
}
931944

932945
private static boolean isPCodedKey(short code) {

0 commit comments

Comments
 (0)