knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "inst/images/README-", out.width = "100%" )
{shinykeyboard} is an R package to create an on-screen keyboard input widget in R Shiny. The package converts beautiful keyboards from Sharla Gelfand's {ggkeyboard} package and turns them into real, clickable on-screen keyboards that return a value of the keystroke.
You can install the released version of {shinykeyboard} from GitHub with:
remotes::install_github("willdebras/shinykeyboard")
The package contains a single UI input function keyboardInput() that takes two parameters:
inputId - the ID of the inputcolor_palette - one of three color palettes from the {ggkeyboard} packagekeyboardInput(inputId = "keebs", color_palette = "sharla3")
An on-screen keyboard will appear in your shiny app.

To return the value for a single key, simply click the key or input the keystroke on your computer keyboard.

To return multiple keystrokes together, either input keystrokes on a keyboard at the same time or toggle the multi-stroke switch at the top of the keyboard.

The package contains three palettes to use by passing to the color_palette parameter.
keyboardInput(inputId = "keebs", color_palette = "sharla1")
```r knitr::include_graphics("inst/images/sharla1.png")
```
keyboardInput(inputId = "keebs", color_palette = "sharla2")
```r knitr::include_graphics("inst/images/sharla2.png")
```
keyboardInput(inputId = "keebs", color_palette = "sharla3")
```r knitr::include_graphics("inst/images/sharla3.png")
```
An example application using the shinykeyboard input:
library(shiny) library(shinykeyboard) ui <- function() { fluidPage( keyboardInput("keebs", color_palette = "sharla1"), verbatimTextOutput("debug") ) } server <- function(input, output) { output$debug <- renderPrint(input$keebs) } shinyApp(ui = ui, server = server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.