当前位置: 首页>>代码示例>>Java>>正文


Java KeyCode.SPACE属性代码示例

本文整理汇总了Java中javafx.scene.input.KeyCode.SPACE属性的典型用法代码示例。如果您正苦于以下问题:Java KeyCode.SPACE属性的具体用法?Java KeyCode.SPACE怎么用?Java KeyCode.SPACE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javafx.scene.input.KeyCode的用法示例。


在下文中一共展示了KeyCode.SPACE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:54,代码来源:OSFXUtils.java

示例2: needManualRecording

private boolean needManualRecording(KeyCode keyCode) {
    return keyCode == KeyCode.BACK_SPACE || keyCode == KeyCode.DELETE || keyCode == KeyCode.ESCAPE || keyCode == KeyCode.SPACE;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:3,代码来源:WSRecorder.java

示例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();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:54,代码来源:JavaFxRecorderHook.java

示例4: keyPressed

@Override protected void keyPressed(KeyEvent ke) {
    if (ke.getCode() == KeyCode.SPACE) {
        recorder.recordRawKeyEvent(this, ke);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:5,代码来源:RFXCheckBox.java

示例5: asKeyCombinationMain

/**
 * Converts the textual representation of a key into a JavaFX {@link KeyCode}
 * @param name Key string
 * @return JavaFX <code>KeyCode</code> object
 */
private static KeyCode asKeyCombinationMain(String name) {
	if(name == null || name.isEmpty())
		throw new IllegalArgumentException("Key definition is null or empty");
	
	name = name.toUpperCase();
	if(name.length() == 1) {
		if(Character.isAlphabetic(name.charAt(0)))
			return KeyCode.valueOf(name);
		if(Character.isDigit(name.charAt(0)))
			return KeyCode.valueOf("DIGIT" + name);
		
		switch(name.charAt(0)) {
		case '&':
			return KeyCode.AMPERSAND;
		case '*':
			return KeyCode.ASTERISK;
		case '^':
			return KeyCode.CIRCUMFLEX;
		case '!':
			return KeyCode.EXCLAMATION_MARK;
		case '\\':
			return KeyCode.BACK_SLASH;
		case '+':
			return KeyCode.PLUS;
		}
		
		throw new IllegalArgumentException("Unknown or unsupported key: " + name);
	}
	
	switch(name) {
	case "BACKSPACE":
		return KeyCode.BACK_SPACE;
	case "SPACE":
	case "SPACEBAR":
		return KeyCode.SPACE;
		
	default:
		return KeyCode.valueOf(name);
	}
}
 
开发者ID:vibridi,项目名称:fxutils,代码行数:45,代码来源:FXKeyboard.java


注:本文中的javafx.scene.input.KeyCode.SPACE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。