unix - Java key release event from STDIN in terminal raw mode -
i'm trying write console game using java, , when hold down key, want move character constantly.
this means need key press , key release events, because there delay when hold down key before starts typing same letter on , over.
i've put terminal raw mode using stty, don't seem getting key release events.
this answer seems indicate can indeed events stdin: https://stackoverflow.com/a/1598436/2404047
what receive when in raw mode single byte keys, in cases, arrow keys, multiple bytes.
is there way can key press , release events through stdin, or console game not doable?
this missunderstanding. cannot events console using pure java.
possible solutions are:
- get events using native utility, redirect them file/pipe , read them java code file
- use jni/jna directly
- use library wraps jni , expose java api purpose. take on charva provides api need , more.
Comments
Post a Comment