Skip to content

R package to create an on-screen keyboard as a custom R Shiny input binding

Notifications You must be signed in to change notification settings

willdebras/shinykeyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shinykeyboard

{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.

Installation

You can install the released version of {shinykeyboard} from GitHub with:

remotes::install_github("willdebras/shinykeyboard")

Usage

The package contains a single UI input function keyboardInput() that takes two parameters:

  • inputId - the ID of the input
  • color_palette - one of three color palettes from the {ggkeyboard} package
 keyboardInput(inputId = "keebs", color_palette = "sharla3")

An on-screen keyboard will appear in your shiny app.

example on screen keyboard

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

example of a keystroke

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.

example of a keystroke

Customization

The package contains three palettes to use by passing to the color_palette parameter.

keyboardInput(inputId = "keebs", color_palette = "sharla1")

keyboardInput(inputId = "keebs", color_palette = "sharla2")

keyboardInput(inputId = "keebs", color_palette = "sharla3")

Example

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)

About

R package to create an on-screen keyboard as a custom R Shiny input binding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages