🌐
IDRSolutions
blog.idrsolutions.com › home › tutorial : how to setup key combinations in javafx
Tutorial : How to Setup Key Combinations in JavaFX
June 28, 2024 - You can add textCmd.setAccelerator(new KeyCodeCombination(KeyCode.C, KeyCombination.SHIFT_DOWN)); and can tell for this the shortkey is “shift + C” · Hi alhelal, yes that is correct.
🌐
Oracle
docs.oracle.com › javafx › 2 › api › javafx › scene › input › KeyCode.html
KeyCode (JavaFX 2.2)
javafx.scene.input · java.lang.Object · java.lang.Enum<KeyCode> javafx.scene.input.KeyCode · All Implemented Interfaces: java.io.Serializable, java.lang.Comparable<KeyCode> public enum KeyCode extends java.lang.Enum<KeyCode> Set of key codes for KeyEvent objects.
🌐
Oracle
docs.oracle.com › javase › 8 › javafx › api › javafx › scene › input › class-use › KeyCode.html
Uses of Class javafx.scene.input.KeyCode (JavaFX 8)
July 15, 2025 - JavaFX 8 · Prev · Next · Frames · No Frames · All Classes · Skip navigation links · Overview · Package · Class · Use · Tree · Deprecated · Index · Help · JavaFX 8 · Prev · Next · Frames · No Frames · All Classes · Copyright (c) 2008, 2015, Oracle and/or its affiliates.
🌐
Java Tips
javatips.net › api › javafx.scene.input.keycode
Java Examples for javafx.scene.input.KeyCode - Javatips.net
private void onKeyPress(KeyEvent event) { if (event == null || event.getCode() == null) { return; } final KeyCode code = event.getCode(); if (code == KeyCode.UP) { caretPos = -1; moveCaret(textField.getLength()); } else if (code == KeyCode.DOWN) { if (!popup.isShowing()) { final Point2D popupPos = textField.localToScreen(0, textField.getHeight()); if (popupPos != null) { popup.sizeToScene(); popup.show(textField, popupPos.getX(), popupPos.getY()); } } caretPos = -1; moveCaret(textField.getLength()); } else if (code == KeyCode.BACK_SPACE) { caretPos = textField.getCaretPosition(); } else if (co
🌐
Oracle
docs.oracle.com › javase › 8 › javafx › api › javafx › scene › input › KeyEvent.html
KeyEvent (JavaFX 8)
3 weeks ago - The key code associated with the key in this key pressed or key released event. For key typed events, code is always KeyCode.UNDEFINED.
🌐
Tabnine
tabnine.com › home page › code › java › javafx.scene.input.keycode
javafx.scene.input.KeyCode java code examples | Tabnine
@SuppressWarnings("deprecation") public static KeyCode findKeyCode(char character) { if (KEY_CODES.containsKey(character)) { return KEY_CODES.get(character); } KeyCode keyCode = KeyCode.getKeyCode(String.valueOf(Character.toUpperCase(character))); if (keyCode != null) { return keyCode; } for (KeyCode code : KeyCode.values()) { if ((char) code.impl_getCode() == character) { return code; } } throw new IllegalArgumentException("No KeyCode found for character: " + character); } }
🌐
OpenJFX
openjfx.io › javadoc › 11 › javafx.graphics › javafx › scene › input › KeyCodeCombination.html
KeyCodeCombination (JavaFX 11)
JavaFX 2.0 · KeyCombination.Modifier, KeyCombination.ModifierValue · ALT_ANY, ALT_DOWN, CONTROL_ANY, CONTROL_DOWN, META_ANY, META_DOWN, NO_MATCH, SHIFT_ANY, SHIFT_DOWN, SHORTCUT_ANY, SHORTCUT_DOWN · getAlt, getControl, getMeta, getShift, getShortcut, keyCombination, toString, valueOf · clone, finalize, getClass, notify, notifyAll, wait, wait, wait · public KeyCodeCombination​(KeyCode code, KeyCombination.ModifierValue shift, KeyCombination.ModifierValue control, KeyCombination.ModifierValue alt, KeyCombination.ModifierValue meta, KeyCombination.ModifierValue shortcut) Constructs a KeyCodeCombination for the specified main key and with an explicit specification of all modifier keys.
🌐
OpenJFX
openjfx.io › javadoc › 11 › javafx.graphics › javafx › scene › input › KeyCode.html
KeyCode (JavaFX 11)
Package javafx.scene.input · java.lang.Object · java.lang.Enum<KeyCode> javafx.scene.input.KeyCode · All Implemented Interfaces: Serializable, Comparable<KeyCode> public enum KeyCode extends Enum<KeyCode> Set of key codes for KeyEvent objects. Since: JavaFX 2.0 ·
Find elsewhere
🌐
DEV Community
dev.to › paulike › key-events-4j35
Key Events - DEV Community
June 24, 2024 - package application; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.text.Text; import javafx.stage.Stage; public class KeyEventDemo extends Application { @Override // Override the start method in the Application class public void start(Stage primaryStage) { // Create a pane and set its properties Pane pane = new Pane(); Text text = new Text(20, 20, "A"); pane.getChildren().add(text); text.setOnKeyPressed(e -> { switch(e.getCode()) { case DOWN: text.setY(text.getY() + 10); break; case UP: text.setY(text.getY() - 10); break;
🌐
Medium
medium.com › @zoha131 › handling-keyboard-shortcuts-in-javafx-2972ba950a48
Handling Keyboard Shortcuts in JavaFx | by Abir Hasan Zoha | Medium
January 18, 2018 - Button btn = new Button("Mnemonic");KeyCombination kc = new KeyCodeCombination(KeyCode.P, KeyCombination.ALT_DOWN);KeyCombination kp = new KeyCharacterCombination("P", KeyCombination.ALT_DOWN);//here kc and kp both are same
🌐
GitHub
github.com › puce77 › openjfx-9-dev-rt › blob › master › modules › graphics › src › main › java › javafx › scene › input › KeyCode.java
openjfx-9-dev-rt/modules/graphics/src/main/java/javafx/scene/input/KeyCode.java at master · puce77/openjfx-9-dev-rt
* @since JavaFX 2.0 · */ public enum KeyCode { · /** * Constant for the {@code Enter} key. */ ENTER(0x0A, "Enter", KeyCodeClass.WHITESPACE), · /** * Constant for the {@code Backspace} key. */ BACK_SPACE(0x08, "Backspace"), ·
Author   puce77