keypress: Read a single keypress at the terminal

Description Usage Arguments Details Value See Also Examples

View source: R/keypress.R

Description

It currently only works at Linux/Unix and OSX terminals, and at the Windows command line. see has_keypress_support.

Usage

1
keypress(block = TRUE)

Arguments

block

Whether to wait for a key press, if there is none available now.

Details

The following special keys are supported:

Value

The key pressed, a character scalar. For non-blocking reads NA is returned if no keys are available.

See Also

Other keypress function: has_keypress_support()

Examples

1
2
x <- keypress()
cat("You pressed key", x, "\n")

keypress documentation built on Jan. 11, 2020, 9:17 a.m.