本文整理匯總了Java中com.jme3.input.KeyInput.KEY_LCONTROL屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyInput.KEY_LCONTROL屬性的具體用法?Java KeyInput.KEY_LCONTROL怎麽用?Java KeyInput.KEY_LCONTROL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.jme3.input.KeyInput
的用法示例。
在下文中一共展示了KeyInput.KEY_LCONTROL屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: keyPressed
@Override
public void keyPressed(KeyInputEvent kie) {
super.keyPressed(kie);
switch (kie.getKeyCode()) {
case KeyInput.KEY_LCONTROL:
leftCtrl = kie.isPressed();
break;
case KeyInput.KEY_C:
point1 = null;
point2 = null;
markerSecondary.removeFromParent();
markerThird.removeFromParent();
line.removeFromParent();
angleText.removeFromParent();
break;
case KeyInput.KEY_UP:
markerThird.move(0f, 0.1f, 0f);
point2.set(markerThird.getLocalTranslation());
updateAngle();
break;
case KeyInput.KEY_DOWN:
markerThird.move(0f, -0.1f, 0f);
point2.set(markerThird.getLocalTranslation());
updateAngle();
break;
}
}
示例3: keyPressed
/**
* Key was pressed.
*/
public void keyPressed(KeyInputEvent kie) {
if (useStraightLine() && (kie.getKeyCode() == KeyInput.KEY_LCONTROL || kie.getKeyCode() == KeyInput.KEY_RCONTROL)) {
doStraightline = kie.isPressed();
if (!doStraightline) { // Clean the values
startPress = null;
axis = null;
}
}
}
示例4: 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();
}
}
}
示例5: isCtrlKey
/**
*
* @param kie
* @return true if the given kie is KEY_LCONTROL || KEY_RCONTROL
*/
public static boolean isCtrlKey(KeyInputEvent kie) {
return (kie.getKeyCode() == KeyInput.KEY_LCONTROL || kie.getKeyCode() == KeyInput.KEY_RCONTROL);
}