本文整理匯總了Java中com.jme3.input.KeyInput.KEY_LSHIFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyInput.KEY_LSHIFT屬性的具體用法?Java KeyInput.KEY_LSHIFT怎麽用?Java KeyInput.KEY_LSHIFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.jme3.input.KeyInput
的用法示例。
在下文中一共展示了KeyInput.KEY_LSHIFT屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onKeyEventQueued
private void onKeyEventQueued(KeyInputEvent evt, NiftyInputConsumer nic) {
int code = evt.getKeyCode();
if (code == KeyInput.KEY_LSHIFT || code == KeyInput.KEY_RSHIFT) {
shiftDown = evt.isPressed();
} else if (code == KeyInput.KEY_LCONTROL || code == KeyInput.KEY_RCONTROL) {
ctrlDown = evt.isPressed();
}
KeyboardInputEvent keyEvt = new KeyboardInputEvent(code,
evt.getKeyChar(),
evt.isPressed(),
shiftDown,
ctrlDown);
if (nic.processKeyboardEvent(keyEvt)){
evt.setConsumed();
}
}
示例2: onKeyEvent
@Override
public void onKeyEvent(KeyInputEvent kie) {
//don't forget the super call
super.onKeyEvent(kie);
if (kie.isPressed()) {
if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
forceCameraControls = true;
}
} else if (kie.isReleased()) {
if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
forceCameraControls = false;
}
}
toolController.doKeyPressed(kie);
}
示例3: onKeyEvent
@Override
public void onKeyEvent(KeyInputEvent kie) {
super.onKeyEvent(kie);
if (kie.isPressed()) {
if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
forceCameraControls = true;
}
} else if (kie.isReleased()) {
if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
forceCameraControls = false;
}
}
toolController.doKeyPressed(kie);
}
示例4: onKeyEvent
public void onKeyEvent(KeyInputEvent kie) {
if (kie.isPressed()) {
if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
shiftModifier = true;
}
} else if (kie.isReleased()) {
if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
shiftModifier = false;
}
}
}
示例5: onKeyEvent
@Override
public void onKeyEvent(KeyInputEvent evt) {
if (evt.getKeyCode() == KeyInput.KEY_LSHIFT || evt.getKeyCode() == KeyInput.KEY_RSHIFT) {
if (evt.isPressed())
keyboardModifiers |= KeyboardUIEvent.SHIFT_MASK;
else
keyboardModifiers &= ~KeyboardUIEvent.SHIFT_MASK;
}
if (evt.getKeyCode() == KeyInput.KEY_LCONTROL || evt.getKeyCode() == KeyInput.KEY_RCONTROL) {
if (evt.isPressed())
keyboardModifiers |= KeyboardUIEvent.CTRL_MASK;
else
keyboardModifiers &= ~KeyboardUIEvent.CTRL_MASK;
}
if (evt.getKeyCode() == KeyInput.KEY_LMENU || evt.getKeyCode() == KeyInput.KEY_RMENU) {
if (evt.isPressed())
keyboardModifiers |= KeyboardUIEvent.ALT_MASK;
else
keyboardModifiers &= ~KeyboardUIEvent.ALT_MASK;
}
if (keyboardFocus != null) {
if (keyboardFocus.getParent() != null && keyboardFocus.isVisible()) {
KeyboardUIEvent kevt = new KeyboardUIEvent(evt, keyboardModifiers, keyboardFocus);
keyboardFocus.keyEvent(kevt);
if (kevt.isConsumed()) {
evt.setConsumed();
return;
}
}
if (evt.getKeyCode() == KeyInput.KEY_ESCAPE) {
resetKeyboardFocus(null);
evt.setConsumed();
}
}
if (evt.getKeyCode() == KeyInput.KEY_TAB && evt.isPressed()) {
if (focusForm != null) {
if ((keyboardModifiers & KeyboardUIEvent.SHIFT_MASK) == 0)
focusForm.tabNext();
else
focusForm.tabPrev();
}
}
}
示例6: isShiftKey
/**
*
* @param kie
* @return true if the given kie is KEY_LSHIFT || KEY_RSHIFT
*/
public static boolean isShiftKey(KeyInputEvent kie) {
return (kie.getKeyCode() == KeyInput.KEY_LSHIFT || kie.getKeyCode() == KeyInput.KEY_RSHIFT);
}