How can I respond to a key press, without a CRLF, in Raku?

151 Views Asked by At

I would like to implement:

Press any key to continue...

That responds to, well, any key without pressing the Return or Enter key.

Term::ReadKey does not implement this behavior. It requires a CRLF.

I'm using iTerm2.

[19] > $*KERNEL
darwin
[20] > $*DISTRO
macos (13.0.1)
[21] > $*RAKU
Raku (6.d)
[22] > $*VM
moar (2022.12)
1

There are 1 best solutions below

1
Elizabeth Mattijsen On BEST ANSWER

I think you will have to use a module to be able to do that in Raku. Term::termios comes to mind.