keysRecordInput {keys} | R Documentation |
Create a keys recorder input control
Description
Create a key input that can be used to record keys pressed by the user.
Usage
keysRecordInput(inputId)
recordKeys(inputId, session = shiny::getDefaultReactiveDomain())
Arguments
inputId |
The input slot that will be used to access the value. |
session |
The |
Examples
if (interactive()) {
library(shiny)
ui <- fluidPage(
useKeys(),
keysRecordInput("recorder"),
keysInput("keys", "command+shift+k"),
actionButton("record", "Record keys")
)
server <- function(input, output, session) {
observeEvent(input$record, {
print("recording keys...")
recordKeys("recorder")
})
observeEvent(input$recorder, {
print("adding keys...")
addKeys("keys", input$recorder)
})
observeEvent(input$keys, {
print(input$keys)
})
}
shinyApp(ui, server)
}
[Package keys version 0.1.1 Index]