How to capture keyboard event without Enter key in java/scala?

可紊 提交于 2019-12-14 02:34:51

问题


I'm writing a game based on terminal and I want capture keyboard event, such as w/a/s/d as direction of Up/Left/Below/Right, rather then readLine a input stream with a Enter key.

Besides, I have read swing package, it has some KeyListener interface but it seems must bind with swing UI.

Does there have pure keyboard event without other technology binding in java world?

来源:https://stackoverflow.com/questions/41938109/how-to-capture-keyboard-event-without-enter-key-in-java-scala

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!