The important part of the page is actually the one titled "Waiting for
potential combiners". You'll want to either use binary encoding instead
of utf8 (the default) or use an encoding that doesn't have combiners,
like latin1 or ascii.


> Problem: also from the link:
>
>     method getc(IO::Handle:D: --> Str:D)
>     multi sub getc (IO::Handle $fh = $*ARGFILES --> Str:D)

my $character = getc();

or

my $character = $*IN.getc();

or

my $character = $my-input-handle.getc();

Since you need to have an encoding that won't wait for combiners after a
key was pressed you'll probably have an open call, for example
"/dev/tty".IO.open(:r);

You are already using termios to make the terminal "raw"; BTW, you only
need either makeraw or the 4 lines of flag setting and unsetting.

Also, the flags you were looking for are in the termios(3) man page. If
your system doesn't have it for some reason, have a look at
https://linux.die.net/man/3/termios

Hope that helps!
  - Timo

Reply via email to