public void enableShiftClickFocusTranslation() { setupRayBasedFocusTranslation(event -> event.isShiftDown()); }
public void enableShiftClickFocusTranslation() { setupRayBasedFocusTranslation(event -> event.isShiftDown()); }
private boolean isModifierCorrect(MouseEvent t, KeyCode keyCode) { return (keyCode != KeyCode.ALT ^ t.isAltDown()) && (keyCode != KeyCode.CONTROL ^ t.isControlDown()) && (keyCode != KeyCode.SHIFT ^ t.isShiftDown()) && (keyCode != KeyCode.META ^ t.isMetaDown()); }
public TextHoverEvent(MouseEvent source, List<HoverTarget> hoverTargets) { super(HOVER, source.getSceneX(), source.getSceneY(), source.getScreenX(), source.getScreenY(), source.getButton(), source.getClickCount(), source.isShiftDown(), source.isControlDown(), source.isAltDown(), source.isMetaDown(), source.isPrimaryButtonDown(), source.isMiddleButtonDown(), source.isSecondaryButtonDown(), source.isSynthesized(), source.isPopupTrigger(), source.isStillSincePress(), source.getPickResult()); this.hoverTargets = Collections.unmodifiableList(hoverTargets); Optional<Range<Integer>> range = this.hoverTargets.stream().map(t->t.textRange).findFirst(); // TODO remove me this.tokenText = null; this.offsetTokenStart = range.isPresent() ? range.get().lowerEndpoint() : 0;; this.offsetTokenEnd = range.isPresent() ? range.get().upperEndpoint() : 0;; this.offset = range.isPresent() ? range.get().lowerEndpoint() : 0; }
@Override public void handle(MouseEvent event) { getBehavior().updateCursor(event, getCurrentVisibleCells(), event.isShiftDown()); // The consuming does not help because it looks like the // selection change happens earlier => should be push a new // ListViewBehavior? event.consume(); } });
if (fxEvent.isShiftDown()) { modifiers |= processing.event.Event.SHIFT;
/** * Registers event filters for windows. * * @param window the window */ public void registerWindowEventFilters(Window window) { window.addEventFilter(MouseEvent.ANY, event -> { if (event.isShiftDown() && event.isControlDown() && !event.isMetaDown() && !event.isAltDown() && event.isPopupTrigger()) { PickResult pickResult = event.getPickResult(); if (pickResult != null) { Node node = pickResult.getIntersectedNode(); if (node != null) { LOGGER.info(() -> "\n" + dumpComponentHierarchy(node)); } } } }); }
/** * Create a new text position event * * @param event * the source mouse event * @param offset * the offset in the text (might be -1 to indicate no valid * region was found) */ public TextPositionEvent(MouseEvent event, int offset) { super(convert(event.getEventType()), event.getSceneX(), event.getSceneY(), event.getScreenX(), event.getScreenY(), event.getButton(), event.getClickCount(), event.isShiftDown(), event.isControlDown(), event.isAltDown(), event.isMetaDown(), event.isPrimaryButtonDown(), event.isMiddleButtonDown(), event.isSecondaryButtonDown(), event.isSynthesized(), event.isPopupTrigger(), event.isStillSincePress(), event.getPickResult()); this.offset = offset; }
/** * Create a new hover event from the original mouse event * * @param event * the event * @param offsetTokenStart * the start offset from the token hovering (might be -1 to * indicate no valid region was found) * @param offsetTokenEnd * the end offset from the token hovering (might be -1 to * indicate no valid region was found) * @param offset * the offset in the text (might be -1 to indicate no valid * region was found) * @param tokenText * the token text */ public TextHoverEvent(MouseEvent event, int offsetTokenStart, int offsetTokenEnd, int offset, String tokenText) { super(HOVER, event.getSceneX(), event.getSceneY(), event.getScreenX(), event.getScreenY(), event.getButton(), event.getClickCount(), event.isShiftDown(), event.isControlDown(), event.isAltDown(), event.isMetaDown(), event.isPrimaryButtonDown(), event.isMiddleButtonDown(), event.isSecondaryButtonDown(), event.isSynthesized(), event.isPopupTrigger(), event.isStillSincePress(), event.getPickResult()); this.offsetTokenStart = offsetTokenStart; this.offsetTokenEnd = offsetTokenEnd; this.tokenText = tokenText; this.offset = offset; this.hoverTargets = null; }
boolean wasSelected = view.getSelectedCountries().contains(country); if (view.getCountrySelectionMode().equals(WorldMapView.SelectionMode.SINGLE) || !(evt.isShortcutDown() || evt.isShiftDown())) { view.getSelectedCountries().clear(); boolean wasSelected = view.getSelectedLocations().contains(location); if (view.getLocationSelectionMode().equals(WorldMapView.SelectionMode.SINGLE) || !(evt.isShortcutDown() || evt.isShiftDown())) { view.getSelectedLocations().clear();
rotationCalculator.setFastModifierPredicate(event -> event.isShiftDown()); cameraOrientation = rotationCalculator.getRotation(); rotationEventHandler = rotationCalculator.createMouseEventHandler(sceneWidthProperty, sceneHeightProperty);
rotationCalculator.setFastModifierPredicate(event -> event.isShiftDown()); cameraOrientation = rotationCalculator.getRotation(); rotationEventHandler = rotationCalculator.createMouseEventHandler(sceneWidthProperty, sceneHeightProperty);
modifier = CONTROL_MULTIPLIER; if (me.isShiftDown()) { modifier = SHIFT_MULTIPLIER;