Echo Keypress to Screen in a Loop
Detect keypress and print it to the terminal screen, while invisibly returning the keypress. The user can specify which characters to ignore, and can also map keys to a list of functions. Any keypress mapped to a function will not be echoed to the screen.
wrkpl(escape = c("escape"), ignore = NA_character_, fn = list(), ...)
escape |
vector of keypresses to escape the loop. |
ignore |
vector of keypresses to ignore. |
fn |
list of functions, named by key, to be called when key is pressed. |
... |
parameters that are passed to |
NULL
## Not run: wrkpl( escape = "escape", fn = list( enter = function(){mv_row(1)}, left = function(){mv(0, -1)}, right = function(){mv(0, 1)}, up = function(){mv(-1,0)}, down = function(){mv(1,0)}, space = function(){cat(" ")} ) ) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.