aboutsummaryrefslogtreecommitdiff
path: root/keyboards/gmmk
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2021-10-15 19:08:00 -0700
committerDrashna Jael're <drashna@live.com>2021-10-15 19:08:00 -0700
commitb36f2609fe6c98ebaa6706feb41859d7bc8c5fe8 (patch)
tree4b4e28600048aab1931d03dd3c1c65c51ff1d2d4 /keyboards/gmmk
parenta1191495132e924cad12533f11c19ba4b8288b0d (diff)
parent4db5d85273c455f9520de28417b8105d902da402 (diff)
downloadqmk_firmware-b36f2609fe6c98ebaa6706feb41859d7bc8c5fe8.tar.gz
qmk_firmware-b36f2609fe6c98ebaa6706feb41859d7bc8c5fe8.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/gmmk')
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c104
-rw-r--r--keyboards/gmmk/pro/ansi/keymaps/benschaeff/readme.md19
2 files changed, 73 insertions, 50 deletions
diff --git a/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c
index 39eac038d..5f3e3f5fd 100644
--- a/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c
+++ b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/keymap.c
@@ -20,7 +20,7 @@ enum userspace_layers {
20}; 20};
21 21
22//custom keycodes 22//custom keycodes
23#define MODS_ALT_MASK (MOD_BIT(KC_LALT)) // Make ALT layer for encoder use 23#define MODS_ALT_MASK (MOD_BIT(KC_LALT)) // Make ALT layer for encoder use
24#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)) // Make CTRL layer for encoder use 24#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)) // Make CTRL layer for encoder use
25#define SWAP_L SGUI(KC_LEFT) // Swap application to left display 25#define SWAP_L SGUI(KC_LEFT) // Swap application to left display
26#define SWAP_R SGUI(KC_RGHT) // Swap application to right display 26#define SWAP_R SGUI(KC_RGHT) // Swap application to right display
@@ -70,54 +70,58 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
70}; 70};
71 71
72 72
73bool encoder_update_user(uint8_t index, bool clockwise) 73bool encoder_update_user(uint8_t index, bool clockwise) {
74{ 74 if (get_mods() & MODS_ALT_MASK) {
75 if (get_mods() & MODS_ALT_MASK) 75 if (clockwise) {
76 { 76 tap_code(KC_TAB);
77 if (clockwise) 77 } else {
78 { 78 tap_code16(S(KC_TAB));
79 tap_code(KC_TAB); 79 }
80 } 80 } else if (get_mods() & MODS_CTRL_MASK) {
81 else 81 if (clockwise) {
82 { 82 tap_code(KC_TAB);
83 tap_code16(S(KC_TAB)); 83 } else {
84 } 84 tap_code16(S(KC_TAB));
85 } 85 }
86 else if (get_mods() & MODS_CTRL_MASK) 86 } else if(IS_LAYER_ON(FNLAYER)) {
87 { 87 if (clockwise) {
88 if (clockwise) 88 tap_code(KC_MEDIA_NEXT_TRACK);
89 { 89 } else {
90 tap_code(KC_TAB); 90 tap_code(KC_MEDIA_PREV_TRACK);
91 } 91 }
92 else 92 } else {
93 { 93 if (clockwise) {
94 tap_code16(S(KC)_TAB)); 94 tap_code(KC_VOLU);
95 95 } else {
96 } 96 tap_code(KC_VOLD);
97 } 97 }
98 else if(IS_LAYER_ON(FNLAYER))
99 {
100 if(clockwise)
101 {
102 tap_code(KC_MEDIA_NEXT_TRACK);
103 }
104 else
105 {
106 tap_code(KC_MEDIA_PREV_TRACK);
107 }
108 } 98 }
109 else 99 return false;
110 { 100}
111 if (clockwise) 101
112 { 102void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
113 tap_code(KC_VOLU); 103 switch(get_highest_layer(layer_state)) {
114 } 104 // special handling per layer
115 else 105 case 0: //layer one
116 { 106 if (host_keyboard_led_state().caps_lock)
117 tap_code(KC_VOLD); 107 rgb_matrix_set_color_all(255,0,0);
118 } 108 else
119 109 rgb_matrix_set_color_all(0,255,56);
110 break;
111 case 1:
112 for (uint8_t i = led_min; i < led_max; i++) {
113 RGB_MATRIX_INDICATOR_SET_COLOR(i,0,0,0);
114 }
115 RGB_MATRIX_INDICATOR_SET_COLOR(0, 0, 0, 255) //esc
116 RGB_MATRIX_INDICATOR_SET_COLOR(6, 0, 0, 255) //f1
117 RGB_MATRIX_INDICATOR_SET_COLOR(8, 0, 0, 255) //q
118 RGB_MATRIX_INDICATOR_SET_COLOR(14, 0, 0, 255) //w
119 RGB_MATRIX_INDICATOR_SET_COLOR(20, 0, 0, 255) //e
120 RGB_MATRIX_INDICATOR_SET_COLOR(15, 0, 0, 255) //s
121 RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 0, 255) //f
122 RGB_MATRIX_INDICATOR_SET_COLOR(49, 0, 0, 255) //R_Alt
123 break;
124 default:
125 break;
120 } 126 }
121 return true; 127}
122
123} \ No newline at end of file
diff --git a/keyboards/gmmk/pro/ansi/keymaps/benschaeff/readme.md b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/readme.md
new file mode 100644
index 000000000..816200289
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/readme.md
@@ -0,0 +1,19 @@
1# Description
2Pretty simple keymap with a few handy tools on a 2nd layer and rotary encoder.
3
4# Encoder
5Holding tab and scrolling encoder will allow scrolling through applications, as if using alt + tab
6Holding ctrl and scrolling encoder will allow scrolling through chrome tabs
7FN + Encoder scroll is media next/prev
8FN + Encoder press is media pause
9default encoder behavior is volume up/down
10
11# Function Layer
12FN + \ is used to put keyboard into bootloader mode
13FN + ESC is the same as alt F4, for closing applications
14FN + F1 is to close current browser tab
15FN + Q moves current application one monitor to the left
16FN + W maximizes current application
17FN + E moves current application one monitor to the right
18FN + S minimizes current application
19FN + F is used in junction with the "Popout tab" extension to chrome (https://chrome.google.com/webstore/detail/popout-tab/pcfcieidiaaobigemjnkclebhnmgfbco) to pop out current tab to its own window