Disable line mode

This commit is contained in:
zontreck 2024-08-31 01:11:43 -07:00
parent c79f2b51a1
commit d0494cb6a2

View file

@ -7,14 +7,14 @@ String getKeyPress() {
while (!ret) {
// Disable line mode to capture a single key press without requiring Enter
//stdin.echoMode = false;
stdin.lineMode = false;
//stdin.lineMode = false;
// Read a single byte from stdin
int byte = stdin.readByteSync();
// Restore line mode and echo mode to default settings
//stdin.echoMode = true;
stdin.lineMode = true;
//stdin.lineMode = true;
// Return the character representation of the byte
str = String.fromCharCode(byte);