README

NAME

Term::ReadKey

DESCRIPTION

Read single (unbuffered) keys from terminal.

SYNOPSIS

use Term::ReadKey;

react {
  whenever key-pressed(:!echo) {
    given .fc {
      when 'q' { done }
      default { .uniname.say }
    }
  }
}

FUNCTIONS

read-key(Bool :$echo = True --> Str)

Reads one unbuffered (unicode) character from STDIN and returns it as Str or Nil if nothing could be read. By default the typed character will be echoed to the terminal unless :!echo is passed as argument.

key-pressed(Bool :$echo = True --> Supply)

Returns a supply that emits characters as soon as they're typed (see example in SYNOPSIS). The named argument :$echo can be used to enable/disable echoing of the character (on by default).

AUTHOR

Jonas Kramer [email protected]

COPYRIGHT AND LICENSE

Copyright 2018 Jonas Kramer.

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Term::ReadKey v0.0.1

Read single unbuffered keys from terminal.

Authors

  • Jonas Kramer

License

Artistic-2.0

Dependencies

Term::termios

Test Dependencies

Provides

  • Term::ReadKey

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.