当前位置: 首页>>代码示例>>Java>>正文


Java KeyInputEvent.isReleased方法代码示例

本文整理汇总了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());
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:12,代码来源:TestBitmapFont.java

示例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();
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:8,代码来源:GUIExplorerAppState.java

示例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);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:16,代码来源:ComposerCameraController.java

示例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);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:15,代码来源:TerrainCameraController.java

示例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;
        }
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:12,代码来源:AbstractCameraController.java

示例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);
				}
			}
		}
	}
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:32,代码来源:Screen.java

示例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;
        }
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:15,代码来源:ComposerCameraController.java

示例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;
        }
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:14,代码来源:TerrainCameraController.java

示例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 
        }
    }
}
 
开发者ID:maany,项目名称:jME-CinematicEditor,代码行数:71,代码来源:SelectTool.java


注:本文中的com.jme3.input.event.KeyInputEvent.isReleased方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。