Giter VIP home page Giter VIP logo

shinykeyboard's Introduction

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)

shinykeyboard's People

Contributors

mayagans avatar willdebras avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.