Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想写一个应用程序。我需要知道哪个函数用于从键盘输入中获取一个键。否则,如何识别在 Java 中按下的键。
您需要实现以下方法来跟踪 J2ME 中的 KeyEvents,
protected void keyPressed(int key) { int keyCode = getGameAction(key); switch ( keyCode ) { case FIRE : { . . . } break; . . . } }
有关更多信息,请查看此示例