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

Method fxScrollEvent

core/src/processing/javafx/PSurfaceFX.java:874–904  ·  view source on GitHub ↗
(ScrollEvent fxEvent)

Source from the content-addressed store, hash-verified

872
873 // https://docs.oracle.com/javase/8/javafx/api/javafx/scene/input/ScrollEvent.html
874 protected void fxScrollEvent(ScrollEvent fxEvent) {
875 // the number of steps/clicks on the wheel for a mouse wheel event.
876 int count = (int) -(fxEvent.getDeltaY() / fxEvent.getMultiplierY());
877
878 int action = processing.event.MouseEvent.WHEEL;
879
880 int modifiers = 0;
881 if (fxEvent.isShiftDown()) {
882 modifiers |= processing.event.Event.SHIFT;
883 }
884 if (fxEvent.isControlDown()) {
885 modifiers |= processing.event.Event.CTRL;
886 }
887 if (fxEvent.isMetaDown()) {
888 modifiers |= processing.event.Event.META;
889 }
890 if (fxEvent.isAltDown()) {
891 modifiers |= processing.event.Event.ALT;
892 }
893
894 // FX does not supply button info
895 int button = 0;
896
897 long when = System.currentTimeMillis();
898 int x = (int) fxEvent.getX(); // getSceneX()?
899 int y = (int) fxEvent.getY();
900
901 sketch.postEvent(new processing.event.MouseEvent(fxEvent, when,
902 action, modifiers,
903 x, y, button, count));
904 }
905
906
907 protected void fxKeyEvent(javafx.scene.input.KeyEvent fxEvent) {

Callers 1

handleMethod · 0.80

Calls 7

isControlDownMethod · 0.80
isMetaDownMethod · 0.80
isAltDownMethod · 0.80
getXMethod · 0.80
getYMethod · 0.80
postEventMethod · 0.80
isShiftDownMethod · 0.45

Tested by

no test coverage detected