/supply.raku Secret
Created
October 27, 2022 10:26
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