Description Usage Arguments Examples
Create a key input that can be used to record keys pressed by the user.
1 2 3 | keysRecordInput(inputId)
recordKeys(inputId, session = shiny::getDefaultReactiveDomain())
|
inputId |
The input slot that will be used to access the value. |
session |
The |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.