
Last chance! 50% off unlimited learning
Sale ends in
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.
wrkp(ignore = "escape", fn = list(), ...)
vector of keypresses to ignore.
list of functions, named by key, to be called when key is pressed.
parameters that are passed to style()
, including the foreground color fg
, background color bg
, and attribute attr
NULL
# NOT RUN {
wrkp(
ignore="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(" ")}
)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab