本文整理匯總了Java中com.jme3.input.KeyInput.KEY_X屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyInput.KEY_X屬性的具體用法?Java KeyInput.KEY_X怎麽用?Java KeyInput.KEY_X使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.jme3.input.KeyInput
的用法示例。
在下文中一共展示了KeyInput.KEY_X屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAxisKey
/**
* Handle the Kie as an axis input : return a Vector3f from the kie keyCode.
*
* @param kie the KeyInputEvent to handle as an Axis
* @return UNIT_X for 'x', UNIT_Y for 'y' and UNIT_Z for 'z' kie.
*/
public static Vector3f getAxisKey(KeyInputEvent kie) {
Vector3f result = Vector3f.ZERO;
switch (kie.getKeyCode()) {
case KeyInput.KEY_X:
result = Vector3f.UNIT_X;
break;
case KeyInput.KEY_Y:
result = Vector3f.UNIT_Y;
break;
case KeyInput.KEY_Z:
result = Vector3f.UNIT_Z;
break;
}
return result;
}
示例2: isAxisKey
/**
* Test if the given kie can be handled as en axis input by the getAxisKey()
* method.
*
* @param kie the KeyInputEvent to test
* @return true is the kie can be handled as an axis input, else false
*/
public static boolean isAxisKey(KeyInputEvent kie) {
switch (kie.getKeyCode()) {
case KeyInput.KEY_X:
case KeyInput.KEY_Y:
case KeyInput.KEY_Z:
return true;
}
return false;
}
示例3: isActivableBy
@Override
public boolean isActivableBy(KeyInputEvent kie) {
if (kie.getKeyCode() == KeyInput.KEY_X && kie.isPressed()) {
ShortcutManager scm = Lookup.getDefault().lookup(ShortcutManager.class);
if (!scm.isActive() && scm.isShiftDown()) {
// ^ can't be enable if an other shortcut is allready active
return true;
}
}
return false;
}