(ScrollEvent fxEvent)
| 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) { |
no test coverage detected