com.jogamp.newt.event.KeyEvent.getKeyCode()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中com.jogamp.newt.event.KeyEvent.getKeyCode()方法的一些代码示例,展示了KeyEvent.getKeyCode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.getKeyCode()方法的具体详情如下:
包路径:com.jogamp.newt.event.KeyEvent
类名称:KeyEvent
方法名:getKeyCode

KeyEvent.getKeyCode介绍

[英]Returns the virtual key code using a fixed mapping to the US keyboard layout.

In contrast to #getKeySymbol(), key code uses a fixed US keyboard layout and therefore is keyboard layout independent.

E.g. virtual key code #VK_Y denotes the same physical key regardless whether keyboard layoutQWERTY or QWERTZ is active. The #getKeySymbol() of the former is #VK_Y, where the latter produces #VK_Y.
[中]使用到美国键盘布局的固定映射返回虚拟键代码。
与#getKeySymbol()不同,按键代码使用固定的美国键盘布局,因此与键盘布局无关。
例如,虚拟键代码#VK_Y表示相同的物理键,无论键盘布局QWERTY还是QWERTZ处于活动状态。前者的#getKeySymbol()是#VK#Y,后者产生#VK#Y。

代码示例

代码示例来源:origin: jzy3d/jzy3d-api

public static int mapKeyCode(KeyEvent event) {
  return jogamp.newt.awt.event.AWTNewtEventFactory.newtKeyCode2AWTKeyCode(event.getKeyCode());
}

代码示例来源:origin: nifty-gui/nifty-gui

private void handleKeyEvent(@Nonnull final KeyEvent e, final boolean isKeyDown) {
 keyboardEvents.add(convert(e, isKeyDown, converter.convertToNiftyKeyCode(e.getKeyCode(), e.getKeySymbol())));
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

@Override
public void keyPressed(KeyEvent e) {
  if (focusedWindow != null) {
    focusedWindow.sendKeyEvent(e.getEventType(), e.getModifiers(),
                  e.getKeyCode(), e.getKeySymbol(), e.getKeyChar());
  }
}

代码示例来源:origin: org.jogamp.jogl/jogl-all-noawt

@Override
public void keyReleased(KeyEvent e) {
  if (focusedWindow != null) {
    focusedWindow.sendKeyEvent(e.getEventType(), e.getModifiers(),
                  e.getKeyCode(), e.getKeySymbol(), e.getKeyChar());
  }
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

throw new InternalError("XXX");
final AWTKeyStroke ks = AWTKeyStroke.getAWTKeyStroke(evt.getKeyCode(), evt.getModifiers(), onRelease);
boolean suppress = false;
if(null != ks) {

代码示例来源:origin: jzy3d/jzy3d-api

Coord2d move = new Coord2d();
float offset = 0.1f;
switch(e.getKeyCode()){
case KeyEvent.VK_DOWN:
  move.y = move.y + offset; rotate( move ); break;
switch(e.getKeyCode()){

代码示例来源:origin: com.io7m.jcamera/com.io7m.jcamera.examples.jogl

switch (e.getKeyCode()) {

代码示例来源:origin: com.io7m.jcamera/com.io7m.jcamera.examples.jogl

switch (e.getKeyCode()) {

代码示例来源:origin: com.io7m.jcamera/com.io7m.jcamera.examples.jogl

switch (e.getKeyCode()) {

代码示例来源:origin: com.io7m.jcamera/com.io7m.jcamera.examples.jogl

switch (e.getKeyCode()) {

代码示例来源:origin: org.processing/core

InputEvent.ALT_MASK);
short code = nativeEvent.getKeyCode();
char keyChar;
int keyCode;

相关文章