-
-
Save lizmat/737f60089a92e0b560bb12bbfed4f17d to your computer and use it in GitHub Desktop.
Pseudocode of a function key supply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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