-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add shortcut and cursor listeners #16
Conversation
I would be happy to test on Mac. I will wait until the pull request has been merged |
Author: Trestle Technology, LLC. | ||
Maintainer: Jeff Allen <jeff@trestletech.com> | ||
Description: Ace editor bindings to enable a rich text editing environment | ||
within Shiny. | ||
within Shiny. (Extension by Sebastian Kranz: add listeners for keys and cursor changes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that CRAN would like this here. Can you remove that line and either add a contributors section to the README or I can after we merge?
Great! Thanks for contributing. I've gone through the code with a few concerns/questions. Whenever you have a chance to go through them I'd love to get your thoughts. Thanks again. |
visible changes: renamed keyId to hotkeys
Hi Jeff, thanks for your good suggestions. I should have implemented all of them with the new commit (if I have not overlooked anything). I also liked "hotkeys" very much as parameter name. |
Thanks again for the code! I had a chance to sit down and really play with it this evening and I agree that it will be a really useful feature to expose to users. I merged it in and added a commit to clean up a couple of minor things and add an example in the Keep the code coming! :) |
Oh, and I added a Contributors section to the README. Let me know if you have a different URL you'd prefer I use for you there. |
Just tested the new hotkeys function. Nice! Any idea if it would be possible to select the current line for runkey and then move the cursor down one line? To use runkey and also an action button (evalRmd) to, for example, run knitr I adapted Jeff's example as shown below. valsRmd <- reactiveValues(knit = 0) observe({ output$rmd_knitDoc <- renderUI({ ... |
Hi Jeff,
here is my pull request related to issue #14. You see that a shortcut event returns a quite detailed list with editorId, selection and so on. I found this detailed return very convenient, in particular when developing apps with multiple dynamically created Ace editor widgets.
It also returns a random number. This is makes it easier to check in R whether indeed a key has been pressed or an observer was just called by Shiny without a new key being pressed. (Shiny has the tendency to call observers too often when working with dynamic UI elements).
I updated the version so that different shortcuts for Windows and Mac can be defined but have not tested it on the Mac yet.
Of course you can remove my name from the description file. That is only for my own documentation.
Best wishes,
Sebastian