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


Java KeyInputEvent.setTime方法代码示例

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

示例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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:AwtKeyInput.java

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

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

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

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


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