我不知道如何获得无缓冲的输入。
我试过:
method get-selection() {
getc();
}
Run Code Online (Sandbox Code Playgroud)
还尝试了 Term::ReadKey 模块:
use Term::ReadKey;
method get-selection() {
read-key();
}
Run Code Online (Sandbox Code Playgroud)
但我仍然必须按 Enter 键才能捕获输入。在文档中找不到任何可能有帮助的内容。
我在 macOS 上。
https://docs.raku.org/type/IO::Handle#routine_getc指出:
仅当您将终端设置为“无缓冲”时,使用 getc 从终端获取单个按键才能正常工作。
对于 MacOS,Google 搜索可以让我:
https://apple.stackexchange.com/questions/193138/to-install-unbuffer-in-osx
| 归档时间: |
|
| 查看次数: |
207 次 |
| 最近记录: |