Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function to add rstudio-like shortcut keys #12

Open
joe-chelladurai opened this issue Dec 19, 2020 · 2 comments
Open

New function to add rstudio-like shortcut keys #12

joe-chelladurai opened this issue Dec 19, 2020 · 2 comments

Comments

@joe-chelladurai
Copy link

This may or may not be within the scope of the package, but I was wondering if adding rstudio-like shortcut keys may be valuable in text inputs or for other possible uses.
Something like: Ctrl+Shift+M = %>% and Alt+- = <-

@tylerlittlefield
Copy link
Member

I haven't thought about it. What use case do you have in mind? The closest you can really get is observing a particular hotkey and updating an input:

library(shiny)
library(keys)
ui <- fluidPage(
  useKeys(),
  keysInput("keys", "command+shift+m"),
  textInput("txt", "txt input")
)

server <- function(input, output, session) {
  observeEvent(input$keys, {
    updateTextInput(session, "txt", value = "%>%")
  })
}

shinyApp(ui, server)

@iqis
Copy link

iqis commented Dec 14, 2022

@joe-chelladurai probably more helpful to look at in-browser coder editors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants