本文整理匯總了Java中com.jme3.input.KeyInput.KEY_RETURN屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyInput.KEY_RETURN屬性的具體用法?Java KeyInput.KEY_RETURN怎麽用?Java KeyInput.KEY_RETURN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.jme3.input.KeyInput
的用法示例。
在下文中一共展示了KeyInput.KEY_RETURN屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onKeyRelease
public void onKeyRelease(KeyInputEvent evt) {
switch (evt.getKeyCode()) {
case KeyInput.KEY_ESCAPE:
case KeyInput.KEY_RETURN:
case KeyInput.KEY_TAB:
break;
default:
evt.setConsumed();
break;
}
}
示例2: InputBox
/**
* Creates a new instance of the AlertBox control
*
* @param screen
* The screen control the Element is to be added to
* @param UID
* A unique String identifier for the Element
* @param position
* A Vector2f containing the x/y position of the Element
* @param dimensions
* A Vector2f containing the width/height dimensions of the
* Element
* @param resizeBorders
* A Vector4f containg the border information used when resizing
* the default image (x = N, y = W, z = E, w = S)
* @param defaultImg
* The default image to use for the AlertBox window
* @param closeable
* closeable
*/
public InputBox(BaseScreen screen, String UID, Vector2f position, Size dimensions, boolean closeable) {
super(screen, UID, position, dimensions, closeable);
form = new Form(screen);
getContentArea().setLayoutManager(new MigLayout(screen, "wrap 1", "[fill, grow]", "[grow][]"));
// Dialog
input = new TextField(screen) {
@Override
public void onKeyRelease(KeyInputEvent evt) {
super.onKeyRelease(evt);
if (evt.getKeyCode() == KeyInput.KEY_RETURN) {
onEnterPressed(evt, input.getText());
}
}
};
getContentArea().addElement(input);
// Button Bar
buttons = new BaseElement(screen);
buttons.setLayoutManager(new FlowLayout(4, BitmapFont.Align.Center));
createButtons(buttons);
getContentArea().addElement(buttons, "growx");
//
input.focus();
}
示例3: isEnterKey
/**
*
* @param kie
* @return true if the given kie is KEY_RETURN
*/
public static boolean isEnterKey(KeyInputEvent kie) {
return (kie.getKeyCode() == KeyInput.KEY_RETURN);
}