keypress: Wait for a single keypress at the terminal

Description Usage Details Value See Also Examples

Description

It currently only works at Linux/Unix and OSX terminals, see has_keypress_support.

Usage

1

Details

The following special keys are supported:

  • Arrow keys: ‘up’, ‘down’, ‘right’, ‘left’.

  • Function keys: from ‘f1’ to ‘f12’.

  • Others: sQuotehome, ‘end’, ‘insert’, ‘delete’, ‘pageup’, ‘pagedown’.

Value

The key pressed, a character scalar.

See Also

Other keypress: has_keypress_support

Examples

1
2
3
4
5
## Not run: 
x <- keypress()
cat("You pressed key", x, "\n")

## End(Not run)


Search within the keypress package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.