本文整理汇总了Java中javafx.scene.input.KeyCode.ALT属性的典型用法代码示例。如果您正苦于以下问题:Java KeyCode.ALT属性的具体用法?Java KeyCode.ALT怎么用?Java KeyCode.ALT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.input.KeyCode
的用法示例。
在下文中一共展示了KeyCode.ALT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isContextMenuKeyEvent
private boolean isContextMenuKeyEvent(KeyEvent event) {
if (!event.getEventType().equals(KeyEvent.KEY_PRESSED)) {
return false;
}
if (event.getCode() == KeyCode.CONTROL || event.getCode() == KeyCode.SHIFT || event.getCode() == KeyCode.ALT
|| event.getCode() == KeyCode.META) {
return false;
}
String keyText = isModifiers(event) ? ketEventGetModifiersExText(event) + "+" : "";
keyText += keyEventGetKeyText(event.getCode());
StringBuffer contextMenuText = new StringBuffer();
if (keyModifiers != null && !keyModifiers.equals("")) {
contextMenuText.append(keyModifiers + "+");
}
contextMenuText.append(key);
return contextMenuText.toString().equals(keyText);
}
示例2: onKeyPressed
protected void onKeyPressed(KeyEvent e) {
if (e.getCode() == KeyCode.CONTROL || e.getCode() == KeyCode.SHIFT || e.getCode() == KeyCode.ALT
|| e.getCode() == KeyCode.META) {
return;
}
String keyText = OSFXUtils.isModifiers(e) ? OSFXUtils.ketEventGetModifiersExText(e) + "+" : "";
keyText += OSFXUtils.keyEventGetKeyText(e.getCode());
keyTriggerField.setText(keyText);
}
示例3: keyEventGetKeyText
public static String keyEventGetKeyText(KeyCode keycode) {
if (keycode == KeyCode.TAB) {
return "Tab";
}
if (keycode == KeyCode.CONTROL) {
return "Ctrl";
}
if (keycode == KeyCode.ALT) {
return "Alt";
}
if (keycode == KeyCode.SHIFT) {
return "Shift";
}
if (keycode == KeyCode.META) {
return "Meta";
}
if (keycode == KeyCode.SPACE) {
return "Space";
}
if (keycode == KeyCode.BACK_SPACE) {
return "Backspace";
}
if (keycode == KeyCode.HOME) {
return "Home";
}
if (keycode == KeyCode.END) {
return "End";
}
if (keycode == KeyCode.DELETE) {
return "Delete";
}
if (keycode == KeyCode.PAGE_UP) {
return "Pageup";
}
if (keycode == KeyCode.PAGE_DOWN) {
return "Pagedown";
}
if (keycode == KeyCode.UP) {
return "Up";
}
if (keycode == KeyCode.DOWN) {
return "Down";
}
if (keycode == KeyCode.LEFT) {
return "Left";
}
if (keycode == KeyCode.RIGHT) {
return "Right";
}
if (keycode == KeyCode.ENTER) {
return "Enter";
}
return keycode.getName();
}
示例4: keyEventGetKeyText
public static String keyEventGetKeyText(KeyCode keyCode) {
if (keyCode == KeyCode.TAB) {
return "Tab";
}
if (keyCode == KeyCode.CONTROL) {
return "Ctrl";
}
if (keyCode == KeyCode.ALT) {
return "Alt";
}
if (keyCode == KeyCode.SHIFT) {
return "Shift";
}
if (keyCode == KeyCode.META) {
return "Meta";
}
if (keyCode == KeyCode.SPACE) {
return "Space";
}
if (keyCode == KeyCode.BACK_SPACE) {
return "Backspace";
}
if (keyCode == KeyCode.HOME) {
return "Home";
}
if (keyCode == KeyCode.END) {
return "End";
}
if (keyCode == KeyCode.DELETE) {
return "Delete";
}
if (keyCode == KeyCode.PAGE_UP) {
return "Pageup";
}
if (keyCode == KeyCode.PAGE_DOWN) {
return "Pagedown";
}
if (keyCode == KeyCode.UP) {
return "Up";
}
if (keyCode == KeyCode.DOWN) {
return "Down";
}
if (keyCode == KeyCode.LEFT) {
return "Left";
}
if (keyCode == KeyCode.RIGHT) {
return "Right";
}
if (keyCode == KeyCode.ENTER) {
return "Enter";
}
return keyCode.getName();
}