diff options
Diffstat (limited to 'users/rmw/encoder_functions.c')
-rw-r--r-- | users/rmw/encoder_functions.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/users/rmw/encoder_functions.c b/users/rmw/encoder_functions.c new file mode 100644 index 000000000..39032d0eb --- /dev/null +++ b/users/rmw/encoder_functions.c | |||
@@ -0,0 +1,53 @@ | |||
1 | // Encoder functions to mix and match! | ||
2 | |||
3 | #include "encoder_functions.h" | ||
4 | |||
5 | void enc_move_words(bool cw){ // Move whole words. Hold shift to select while moving. | ||
6 | if (cw) { | ||
7 | tap_code16(A(KC_RGHT)); | ||
8 | } else { | ||
9 | tap_code16(A(KC_LEFT)); | ||
10 | } | ||
11 | } | ||
12 | void enc_history_scrubbing(bool cw){ // Undo/Redo. | ||
13 | if (cw) { | ||
14 | tap_code16(G(S(KC_Z))); | ||
15 | } else { | ||
16 | tap_code16(G(KC_Z)); | ||
17 | } | ||
18 | } | ||
19 | void enc_scrolling(bool cw){ // Scrolling. | ||
20 | if (cw) { | ||
21 | tap_code(KC_MS_WH_DOWN); | ||
22 | } else { | ||
23 | tap_code(KC_MS_WH_UP); | ||
24 | } | ||
25 | } | ||
26 | void enc_scrolling_h(bool cw){ // Scrolling. | ||
27 | if (cw) { | ||
28 | tap_code(KC_MS_WH_RIGHT); | ||
29 | } else { | ||
30 | tap_code(KC_MS_WH_LEFT); | ||
31 | } | ||
32 | } | ||
33 | void enc_volume_knob(bool cw){ // Volume control. | ||
34 | if (cw) { | ||
35 | tap_code(KC_VOLU); | ||
36 | } else { | ||
37 | tap_code(KC_VOLD); | ||
38 | } | ||
39 | } | ||
40 | void enc_move_desktop(bool cw){ // Switch Desktops (Mac). | ||
41 | if (cw) { | ||
42 | tap_code16(C(KC_RIGHT)); | ||
43 | } else { | ||
44 | tap_code16(C(KC_LEFT)); | ||
45 | } | ||
46 | } | ||
47 | void enc_zoom(bool cw){ // Zoom in/zoom out. | ||
48 | if (cw) { | ||
49 | tap_code16(G(KC_PLUS)); | ||
50 | } else { | ||
51 | tap_code16(G(KC_MINUS)); | ||
52 | } | ||
53 | } | ||