Skip to content

Commit 4384feb

Browse files
nathancdaylionel-
authored andcommitted
Use up/down arrows to switch type
1 parent 8af6f6c commit 4384feb

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11

22
# vdiffr 0.3.1.9000
33

4+
- Keyboard short cuts for common interactions:
5+
Right/Left arrows = Next/Previous case
6+
Down/Up arrows = Next/Previous type
7+
ENTER = Validate active case
8+
shift + ENTER = Validate active group
9+
ESC = Quit app
10+
411
# vdiffr 0.3.1
512

613
This release makes vdiffr compatible with ggplot2 3.2.0. It also

inst/www/toggle.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ function toggleBtns(message) {
1818
//Keyboard shortcuts
1919
document.onkeydown = function(e) {
2020
if (e.shiftKey) { // using e.shiftKey && e.which == 86 simultaneously doesn't work?
21-
if (e.which == 39) { // down-arrow
22-
Shiny.onInputChange("nextType", Math.random());
23-
} else if (e.which == 37) { //up-arrow
24-
Shiny.onInputChange("prevType", Math.random());
25-
} else if (e.which == 86) { // v
21+
if (e.which == 13) { // ENTER
2622
Shiny.onInputChange("validateGroup", Math.random());
2723
}
2824
} else {
2925
if (e.which == 39) { // right-arrow
3026
Shiny.onInputChange("nextCase", Math.random());
3127
} else if (e.which == 37) { // left-arrow
3228
Shiny.onInputChange("prevCase", Math.random());
33-
} else if (e.which == 86) { // v
29+
} else if (e.which == 40) { // down-arrow
30+
Shiny.onInputChange("nextType", Math.random());
31+
} else if (e.which == 38) { //up-arrow
32+
Shiny.onInputChange("prevType", Math.random());
33+
} else if (e.which == 13) { // ENTER
3434
Shiny.onInputChange("validateCase", Math.random());
3535
} else if (e.which == 27) { //esc, q = 81
3636
Shiny.onInputChange("quit_button", Math.random());

0 commit comments

Comments
 (0)