List of usage examples for javafx.scene.input ScrollEvent isShiftDown
public final boolean isShiftDown()
From source file:net.rptools.tokentool.controller.TokenTool_Controller.java
@FXML void compositeTokenPane_OnScroll(ScrollEvent event) { // if event is touch enabled, skip this as it will be handled by onZoom & onRotate handlers if (event.isDirect()) return;/*from w ww . ja v a 2 s . co m*/ if (event.isShiftDown()) { // Note: OK, this is stupid but on Windows shift + mousewheel returns X delta but on Ubuntu it returns Y delta... double delta = event.getDeltaY(); if (delta == 0) delta = event.getDeltaX(); Double r = portraitImageView.getRotate() + delta / 20; if (r < -360d || r > 360d) r = 0d; portraitImageView.setRotate(r); } else { Double scale = portraitImageView.getScaleY() * Math.pow(1.001, event.getDeltaY()); portraitImageView.setScaleX(scale); portraitImageView.setScaleY(scale); } event.consume(); updateTokenPreviewImageView(); }