keys icon indicating copy to clipboard operation
keys copied to clipboard

Add nullOnKeyRelease option

Open DavidBarke opened this issue 1 year ago • 0 comments

This pull requests adds the option nullOnKeyRelease to keysInput and addKeys. If this option is set, the Shiny input will be set to NULL after any of the bound keys is released.

This option enables to detect whether a key is pressed. Consider an actionButton whose action depends on whether ctrl is pressed or not. Without this option, the Shiny input is "ctrl" as long as ctrl has been pressed any time in the past. With this option, the Shiny input is only "ctrl" if ctrl is still pressed and else NULL.

DavidBarke avatar May 23 '24 10:05 DavidBarke