runApp(list(
ui = shinyUI(bootstrapPage(
tags$div(class = "inliner", style = "display:inline;",
textInput("test_text", label = "test for keys"),
textInput("test2", label = "second test")
)
,
verbatimTextOutput("results"),
tags$script('
$(document.getElementById("test_text")).on("keydown", function (e) {
Shiny.onInputChange("mydata", e.which);
});
')
)),
server = shinyServer(function(input, output, session) {
output$results = renderPrint({
input$mydata
})
})
))