@Override public void handle(KeyEvent keyEvent) { if (keyEvent.isShortcutDown()) { if (keyEvent.getCode() == KeyCode.P) { //Code Here Point mouseLoc = MouseInfo.getPointerInfo().getLocation(); } }
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public void setType(Class<?> type) { super.setType(type); // choice box does not need a value translator because the items are already of model type // and choice-box is not editable // deselect by DELETE- or BACKSPACE-key (with or without shift) component.addEventFilter(KeyEvent.KEY_PRESSED, event -> { if (!event.isAltDown() && !event.isControlDown() && !event.isMetaDown() && !event.isShortcutDown() && (event.getCode() == KeyCode.DELETE || event.getCode() == KeyCode.BACK_SPACE) && !component.isDisabled() && isDeselectAllowed()) { event.consume(); component.getSelectionModel().clearSelection(); } }); if (type.isEnum()) { ObservableList items = component.getItems(); items.clear(); items.addAll(Arrays.asList(type.getEnumConstants())); } }
@Override @SuppressWarnings("unchecked") public void setType(Class<?> type) { // important to set the type before creating the translator, // since the translator may need to know the type super.setType(type); // deselect by DELETE- or BACKSPACE-key (with or without shift) component.addEventFilter(KeyEvent.KEY_PRESSED, event -> { if (!event.isAltDown() && !event.isControlDown() && !event.isMetaDown() && !event.isShortcutDown() && (event.getCode() == KeyCode.DELETE || event.getCode() == KeyCode.BACK_SPACE) && !component.isEditable() && !component.isDisabled() && isDeselectAllowed()) { event.consume(); component.getSelectionModel().clearSelection(); } }); if (type.isEnum()) { ObservableList items = component.getItems(); items.clear(); items.addAll(Arrays.asList(type.getEnumConstants())); } }
if (event.isShortcutDown()) { getControl().paste(); event.consume(); if (event.isShortcutDown()) { getControl().cut(); event.consume(); if (event.isShortcutDown()) { getControl().copy(); event.consume();
if( event.isShortcutDown() ) { getControl().pseudoClassStateChanged(DRAG_TEXT_MOVE_ACTIVE_PSEUDOCLASS_STATE, false); getControl().pseudoClassStateChanged(DRAG_TEXT_COPY_ACTIVE_PSEUDOCLASS_STATE, true);