本文整理汇总了Java中com.jme3.input.event.KeyInputEvent.setTime方法的典型用法代码示例。如果您正苦于以下问题:Java KeyInputEvent.setTime方法的具体用法?Java KeyInputEvent.setTime怎么用?Java KeyInputEvent.setTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.event.KeyInputEvent
的用法示例。
在下文中一共展示了KeyInputEvent.setTime方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
public void update() {
if (!context.isRenderable())
return;
Keyboard.poll();
while (Keyboard.next()){
int keyCode = Keyboard.getEventKey();
char keyChar = Keyboard.getEventCharacter();
boolean pressed = Keyboard.getEventKeyState();
boolean down = Keyboard.isRepeatEvent();
long time = Keyboard.getEventNanoseconds();
KeyInputEvent evt = new KeyInputEvent(keyCode, keyChar, pressed, down);
evt.setTime(time);
listener.onKeyEvent(evt);
}
}
示例2: keyTyped
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
public void keyTyped(KeyEvent evt) {
// key code is zero for typed events
int code = 0;
//int code = convertAwtKey(evt.getKeyCode());
KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, true);
keyEvent.setTime(evt.getWhen());
eventQueue.add(keyEvent);
}
示例3: keyPressed
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
public void keyPressed(KeyEvent evt) {
int code = convertAwtKey(evt.getKeyCode());
KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, false);
keyEvent.setTime(evt.getWhen());
synchronized (eventQueue){
eventQueue.add(keyEvent);
}
}
示例4: keyReleased
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
public void keyReleased(KeyEvent evt) {
int code = convertAwtKey(evt.getKeyCode());
KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, false);
keyEvent.setTime(evt.getWhen());
synchronized (eventQueue){
eventQueue.add(keyEvent);
}
}
示例5: keyPressed
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
public void keyPressed(KeyEvent evt) {
int code = convertAwtKey(evt.getKeyCode());
KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, false);
keyEvent.setTime(evt.getWhen());
eventQueue.add(keyEvent);
}
示例6: keyReleased
import com.jme3.input.event.KeyInputEvent; //导入方法依赖的package包/类
public void keyReleased(KeyEvent evt) {
int code = convertAwtKey(evt.getKeyCode());
KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, false);
keyEvent.setTime(evt.getWhen());
eventQueue.add(keyEvent);
}