https://toitlang.org/ logo
How to wait in a host app for an user input (keybo...
# help
k
I want to react to user input via keyboard.
f
On the host, you can access `stdin`: https://pkg.toit.io/github.com/toitlang/pkg-host@1.15.1/docs/host/pipe/library-summary#stdin(0%2C0%2C0%2C)
I'm not sure if that allows you to read individual characters, or if that only gives you lines ( @erikcorry might know).
On the device we haven't exposed the input-pin yet. You can work around it, by changing the sdkconfig so that the logging UART RX goes to a different (unused) pin, and then opening another UART on the actual RX pin.
e
It should give you individual characters but if stdin is a TTY then the tty settings will determine if it's line buffered, normally it is.
2 Views