# NOT RUN {
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)
}
# }
Run the code above in your browser using DataLab