Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created October 27, 2022 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizmat/737f60089a92e0b560bb12bbfed4f17d to your computer and use it in GitHub Desktop.
Save lizmat/737f60089a92e0b560bb12bbfed4f17d to your computer and use it in GitHub Desktop.
Pseudocode of a function key supply
use Term::ReadKey;
sub function-keys(:$echo) {
supply {
my @seen;
whenever key-pressed($!echo) -> \value {
@seen.push: value;
if @seen eqv [1,2,3,4] {
emit associated function key value;
@seen = ();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment