dr-consulting / ibi_VizEdit

Programming Components for Modeling & Editing Heart Rate Data
0 stars 3 forks source link

Add keyboard key bindings for main editing functions #71

Open matgbar opened 4 years ago

matgbar commented 4 years ago

SCENARIO: ALEX or LOGAN wants to reduce the sole reliance on click-and-point reactivity within the gui and have the most common editing actions mapped to keyboard keys in such a way that perfectly replicates the effect of pressing the corresponding actionButton in the gui.

GIVEN: ALEX or LOGAN have appropriately selected a subset of points to edit.

WHEN: ALEX or LOGAN hits the a key on their keyboard

THEN: IBI_VizEdit should react the same as if they had clicked on the Average actionButton`.

Notes:

  1. Key mapping numbers can be found here: http://keycode.info/
  2. a = Average; c = Combine; d = Divide; i = Insert; and r = Remove
  3. This is going to take some javascript magic passed into the the UI - just for reference.
  4. Some limited examples can be found here and here
  5. Lastly here is the first draft of a function that returns the javascript text to be inserted into the UI portion of the application. It is almost certainly going to need some work. (think also about how to mock key presses for unit tests).

https://github.com/matgbar/IBI_VizEdit/blob/07d2bae820a39b8febcf2793d845c703062f9a9b/R/hotkey_utils.R#L11-L32

matgbar commented 4 years ago

Not part of the re-factor & package epic, but I plan to release this enhancement along with all of the changes outlined in https://github.com/matgbar/IBI_VizEdit/issues/63.