MCPcopy Index your code
hub / github.com/processing/processing / fxKeyEvent

Method fxKeyEvent

core/src/processing/javafx/PSurfaceFX.java:907–939  ·  view source on GitHub ↗
(javafx.scene.input.KeyEvent fxEvent)

Source from the content-addressed store, hash-verified

905
906
907 protected void fxKeyEvent(javafx.scene.input.KeyEvent fxEvent) {
908 int action = 0;
909 EventType<? extends KeyEvent> et = fxEvent.getEventType();
910 if (et == KeyEvent.KEY_PRESSED) {
911 action = processing.event.KeyEvent.PRESS;
912 } else if (et == KeyEvent.KEY_RELEASED) {
913 action = processing.event.KeyEvent.RELEASE;
914 } else if (et == KeyEvent.KEY_TYPED) {
915 action = processing.event.KeyEvent.TYPE;
916 }
917
918 int modifiers = 0;
919 if (fxEvent.isShiftDown()) {
920 modifiers |= processing.event.Event.SHIFT;
921 }
922 if (fxEvent.isControlDown()) {
923 modifiers |= processing.event.Event.CTRL;
924 }
925 if (fxEvent.isMetaDown()) {
926 modifiers |= processing.event.Event.META;
927 }
928 if (fxEvent.isAltDown()) {
929 modifiers |= processing.event.Event.ALT;
930 }
931
932 long when = System.currentTimeMillis();
933
934 char keyChar = getKeyChar(fxEvent);
935 int keyCode = getKeyCode(fxEvent);
936 sketch.postEvent(new processing.event.KeyEvent(fxEvent, when,
937 action, modifiers,
938 keyChar, keyCode));
939 }
940
941
942 @SuppressWarnings("deprecation")

Callers 1

handleMethod · 0.80

Calls 7

getKeyCharMethod · 0.95
getKeyCodeMethod · 0.95
isControlDownMethod · 0.80
isMetaDownMethod · 0.80
isAltDownMethod · 0.80
postEventMethod · 0.80
isShiftDownMethod · 0.45

Tested by

no test coverage detected