如果我按住up和down键,然后按下调用Display.update的按钮并运行以下代码:
while (!Keyboard.isKeyDown(Keyboard.KEY_SPACE);
Display.update();
boolean up = Keyboard.isKeyDown(Keyboard.KEY_UP);
Thread.sleep(500);
boolean down = Keyboard.isKeyDown(Keyboard.KEY_DOWN);
if (up && down)
System.out.println("Both keys detected");
结果会是什么?我不确定我是否应该在游戏更新期间一次检查所有键,还是只在需要它们时检查它们。