本文整理汇总了Java中com.jme3.input.event.KeyInputEvent.isReleased方法的典型用法代码示例。如果您正苦于以下问题:Java KeyInputEvent.isReleased方法的具体用法?Java KeyInputEvent.isReleased怎么用?Java KeyInputEvent.isReleased使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.event.KeyInputEvent
的用法示例。
在下文中一共展示了KeyInputEvent.isReleased方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@Override
public void onKeyEvent(KeyInputEvent evt) {
if (evt.isReleased())
return;
if (evt.getKeyChar() == '\n' || evt.getKeyChar() == '\r') {
txt3.setText(str.toString());
str.setLength(0);
} else {
str.append(evt.getKeyChar());
}
}
示例2: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@Override
public void onKeyEvent(KeyInputEvent evt) {
if (evt.getKeyCode() == KeyInput.KEY_ESCAPE && evt.isReleased()) {
endPick();
evt.setConsumed();
}
}
示例3: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@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);
}
示例4: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@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);
}
示例5: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
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;
}
}
}
示例6: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@Override
public void onKeyEvent(KeyInputEvent evt) {
if (evt.getKeyCode() == KeyInput.KEY_LSHIFT || evt.getKeyCode() == KeyInput.KEY_RSHIFT) {
if (evt.isPressed()) SHIFT = true;
else SHIFT = false;
}
if (evt.getKeyCode() == KeyInput.KEY_LCONTROL || evt.getKeyCode() == KeyInput.KEY_RCONTROL) {
if (evt.isPressed()) CTRL = true;
else CTRL = false;
}
if (evt.getKeyCode() == KeyInput.KEY_LMENU || evt.getKeyCode() == KeyInput.KEY_RMENU) {
if (evt.isPressed()) ALT = true;
else ALT = false;
}
if (evt.getKeyCode() == KeyInput.KEY_TAB && evt.isPressed()) {
if (focusForm != null) {
if (!SHIFT) focusForm.tabNext();
else focusForm.tabPrev();
}
} else {
if (keyboardElement != null) {
if (keyboardElement.getParent() != null && keyboardElement.getIsVisible()) {
if (evt.isPressed()) {
((KeyboardListener)keyboardElement).onKeyPress(evt);
} else if (evt.isReleased()) {
((KeyboardListener)keyboardElement).onKeyRelease(evt);
}
}
}
}
}
示例7: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@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;
}
}
}
示例8: onKeyEvent
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
@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;
}
}
}
示例9: keyPressed
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
/**
* This is stateful:
* First it checks for a command (rotate, translate, delete, etc..)
* Then it checks for an axis (x,y,z)
* Then it checks for a number (user typed a number
* Then, finally, it checks if Enter was hit.
*
* If either of the commands was actioned, the preceeding states/axis/amount
* will be reset. For example if the user types: G Y 2 R
* Then it will:
* 1) Set state as 'Translate' for the G (grab)
* 2) Set the axis as 'Y'; it will translate along the Y axis
* 3) Distance will be 2, when the 2 key is hit
* 4) Distance, Axis, and state are then reset because a new state was set: Rotate
* it won't actually translate because 'Enter' was not hit and 'R' reset the state.
*
*/
@Override
public void keyPressed(KeyInputEvent kie) {
checkModificatorKeys(kie); // alt,shift,ctrl
Spatial selected = toolController.getSelectedSpatial();
if (selected == null) {
return; // only do anything if a spatial is selected
}
// key released
if (kie.isReleased()) {
boolean commandUsed = checkCommandKey(kie);
boolean stateChange = checkStateKey(kie);
boolean axisChange = checkAxisKey(kie);
boolean numberChange = checkNumberKey(kie);
boolean enterHit = checkEnterHit(kie);
boolean escHit = checkEscHit(kie);
if (commandUsed) {
return; // commands take priority
}
if (stateChange) {
currentAxis = Vector3f.UNIT_XYZ;
numberBuilder = new StringBuilder();
recordInitialState(selected);
} else if (axisChange) {
} else if (numberChange) {
} else if (enterHit) {
if (currentState != null && numberBuilder.length() > 0) {
applyKeyedChangeState(selected);
clearState(false);
}
}
// -----------------------
// reset conditions below:
if (escHit) {
if (moving != null) {
moving.sceneUndo();
}
moving = null;
clearState();
}
if (!stateChange && !axisChange && !numberChange && !enterHit && !escHit) {
// nothing valid was hit, reset the state
//clearState(); // this will be
}
}
}