Skip to content

How to read keys in the console? #2333

Answered by z64
programandala-net asked this question in Q&A
Discussion options

You must be logged in to vote

Odin's core/vendor lib currently doesn't provide an abstraction for terminal ops.
You can follow any guide written for C, or check the source / step through what V does.

Some notes/examples: https://viewsourcecode.org/snaptoken/kilo/02.enteringRawMode.html
Termios docs: https://man7.org/linux/man-pages/man3/tcflow.3.html (See "Raw mode" header)

No warranty on these, but here's some bindings I used in a personal tool for some of the OS APIs mentioned in that article:
https://gist.github.com/z64/f29dbd97fa3579896787f38c7386b184

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by programandala-net
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@programandala-net
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants