summaryrefslogtreecommitdiff
path: root/keyboards/gmmk/pro/ansi
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/gmmk/pro/ansi')
-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 39eac038d1..5f3e3f5fd8 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 {
};
//custom keycodes
-#define MODS_ALT_MASK (MOD_BIT(KC_LALT)) // Make ALT layer for encoder use
+#define MODS_ALT_MASK (MOD_BIT(KC_LALT)) // Make ALT layer for encoder use
#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)) // Make CTRL layer for encoder use
#define SWAP_L SGUI(KC_LEFT) // Swap application to left display
#define SWAP_R SGUI(KC_RGHT) // Swap application to right display
@@ -70,54 +70,58 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
-bool encoder_update_user(uint8_t index, bool clockwise)
-{
- if (get_mods() & MODS_ALT_MASK)
- {
- if (clockwise)
- {
- tap_code(KC_TAB);
- }
- else
- {
- tap_code16(S(KC_TAB));
- }
- }
- else if (get_mods() & MODS_CTRL_MASK)
- {
- if (clockwise)
- {
- tap_code(KC_TAB);
- }
- else
- {
- tap_code16(S(KC)_TAB));
-
- }
- }
- else if(IS_LAYER_ON(FNLAYER))
- {
- if(clockwise)
- {
- tap_code(KC_MEDIA_NEXT_TRACK);
- }
- else
- {
- tap_code(KC_MEDIA_PREV_TRACK);
- }
+bool encoder_update_user(uint8_t index, bool clockwise) {
+ if (get_mods() & MODS_ALT_MASK) {
+ if (clockwise) {
+ tap_code(KC_TAB);
+ } else {
+ tap_code16(S(KC_TAB));
+ }
+ } else if (get_mods() & MODS_CTRL_MASK) {
+ if (clockwise) {
+ tap_code(KC_TAB);
+ } else {
+ tap_code16(S(KC_TAB));
+ }
+ } else if(IS_LAYER_ON(FNLAYER)) {
+ if (clockwise) {
+ tap_code(KC_MEDIA_NEXT_TRACK);
+ } else {
+ tap_code(KC_MEDIA_PREV_TRACK);
+ }
+ } else {
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
}
- else
- {
- if (clockwise)
- {
- tap_code(KC_VOLU);
- }
- else
- {
- tap_code(KC_VOLD);
- }
-
+ return false;
+}
+
+void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
+ switch(get_highest_layer(layer_state)) {
+ // special handling per layer
+ case 0: //layer one
+ if (host_keyboard_led_state().caps_lock)
+ rgb_matrix_set_color_all(255,0,0);
+ else
+ rgb_matrix_set_color_all(0,255,56);
+ break;
+ case 1:
+ for (uint8_t i = led_min; i < led_max; i++) {
+ RGB_MATRIX_INDICATOR_SET_COLOR(i,0,0,0);
+ }
+ RGB_MATRIX_INDICATOR_SET_COLOR(0, 0, 0, 255) //esc
+ RGB_MATRIX_INDICATOR_SET_COLOR(6, 0, 0, 255) //f1
+ RGB_MATRIX_INDICATOR_SET_COLOR(8, 0, 0, 255) //q
+ RGB_MATRIX_INDICATOR_SET_COLOR(14, 0, 0, 255) //w
+ RGB_MATRIX_INDICATOR_SET_COLOR(20, 0, 0, 255) //e
+ RGB_MATRIX_INDICATOR_SET_COLOR(15, 0, 0, 255) //s
+ RGB_MATRIX_INDICATOR_SET_COLOR(26, 0, 0, 255) //f
+ RGB_MATRIX_INDICATOR_SET_COLOR(49, 0, 0, 255) //R_Alt
+ break;
+ default:
+ break;
}
- return true;
-
-} \ 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 0000000000..8162002892
--- /dev/null
+++ b/keyboards/gmmk/pro/ansi/keymaps/benschaeff/readme.md
@@ -0,0 +1,19 @@
+# Description
+Pretty simple keymap with a few handy tools on a 2nd layer and rotary encoder.
+
+# Encoder
+Holding tab and scrolling encoder will allow scrolling through applications, as if using alt + tab
+Holding ctrl and scrolling encoder will allow scrolling through chrome tabs
+FN + Encoder scroll is media next/prev
+FN + Encoder press is media pause
+default encoder behavior is volume up/down
+
+# Function Layer
+FN + \ is used to put keyboard into bootloader mode
+FN + ESC is the same as alt F4, for closing applications
+FN + F1 is to close current browser tab
+FN + Q moves current application one monitor to the left
+FN + W maximizes current application
+FN + E moves current application one monitor to the right
+FN + S minimizes current application
+FN + 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