summaryrefslogtreecommitdiff
path: root/keyboards/ergodox_ez/keymaps
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-07-25 18:18:22 -0700
committerGitHub <noreply@github.com>2021-07-25 18:18:22 -0700
commitd45da3f0fb76222a2af63b0b61f21ae78117b2d4 (patch)
tree179d3cefe72927d0759008a255437bf17419dc24 /keyboards/ergodox_ez/keymaps
parentfc9fb2c77505cf1dcf5d1f50dd61a980471b3494 (diff)
[Keyboard] Update ZSA Keyboard Readmes and keymaps (#13041)
* [Keyboard] Update ZSA Keyboard Readmes and keymaps * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> * Remove custom rgb code for RGB_M_P * Fix inevitable typo Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/planck/ez/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/ergodox_ez/keymaps')
-rw-r--r--keyboards/ergodox_ez/keymaps/default/keymap.c156
1 files changed, 76 insertions, 80 deletions
diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c
index 9079e48fcb..3c0ef320a4 100644
--- a/keyboards/ergodox_ez/keymaps/default/keymap.c
+++ b/keyboards/ergodox_ez/keymaps/default/keymap.c
@@ -2,20 +2,20 @@
#include "version.h"
enum layers {
- BASE, // default layer
- SYMB, // symbols
+ BASE, // default layer
+ SYMB, // symbols
MDIA, // media keys
};
enum custom_keycodes {
#ifdef ORYX_CONFIGURATOR
- VRSN = EZ_SAFE_RANGE,
+ VRSN = EZ_SAFE_RANGE,
#else
- VRSN = SAFE_RANGE,
+ VRSN = SAFE_RANGE,
#endif
- RGB_SLD
};
+// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
@@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
- RGB_MOD, KC_TRNS, RGB_TOG, RGB_SLD,
+ RGB_MOD, KC_TRNS, RGB_TOG, RGB_M_P,
KC_TRNS, KC_TRNS,
RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, RGB_HUD, RGB_HUI
),
@@ -115,94 +115,90 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK
),
};
+// clang-format on
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
- switch (keycode) {
- case VRSN:
- SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
- return false;
- #ifdef RGBLIGHT_ENABLE
- case RGB_SLD:
- rgblight_mode(1);
- return false;
- #endif
+ if (record->event.pressed) {
+ switch (keycode) {
+ case VRSN:
+ SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
+ return false;
+ }
}
- }
- return true;
+ return true;
}
// Runs just one time when the keyboard initializes.
void keyboard_post_init_user(void) {
#ifdef RGBLIGHT_COLOR_LAYER_0
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif
};
// Runs whenever there is a layer state change.
layer_state_t layer_state_set_user(layer_state_t state) {
- ergodox_board_led_off();
- ergodox_right_led_1_off();
- ergodox_right_led_2_off();
- ergodox_right_led_3_off();
+ ergodox_board_led_off();
+ ergodox_right_led_1_off();
+ ergodox_right_led_2_off();
+ ergodox_right_led_3_off();
- uint8_t layer = get_highest_layer(state);
- switch (layer) {
- case 0:
- #ifdef RGBLIGHT_COLOR_LAYER_0
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
- #endif
- break;
- case 1:
- ergodox_right_led_1_on();
- #ifdef RGBLIGHT_COLOR_LAYER_1
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
- #endif
- break;
- case 2:
- ergodox_right_led_2_on();
- #ifdef RGBLIGHT_COLOR_LAYER_2
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
- #endif
- break;
- case 3:
- ergodox_right_led_3_on();
- #ifdef RGBLIGHT_COLOR_LAYER_3
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
- #endif
- break;
- case 4:
- ergodox_right_led_1_on();
- ergodox_right_led_2_on();
- #ifdef RGBLIGHT_COLOR_LAYER_4
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
- #endif
- break;
- case 5:
- ergodox_right_led_1_on();
- ergodox_right_led_3_on();
- #ifdef RGBLIGHT_COLOR_LAYER_5
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
- #endif
- break;
- case 6:
- ergodox_right_led_2_on();
- ergodox_right_led_3_on();
- #ifdef RGBLIGHT_COLOR_LAYER_6
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
- #endif
- break;
- case 7:
- ergodox_right_led_1_on();
- ergodox_right_led_2_on();
- ergodox_right_led_3_on();
- #ifdef RGBLIGHT_COLOR_LAYER_7
- rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7);
- #endif
- break;
- default:
- break;
+ uint8_t layer = get_highest_layer(state);
+ switch (layer) {
+ case 0:
+#ifdef RGBLIGHT_COLOR_LAYER_0
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
+#endif
+ break;
+ case 1:
+ ergodox_right_led_1_on();
+#ifdef RGBLIGHT_COLOR_LAYER_1
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
+#endif
+ break;
+ case 2:
+ ergodox_right_led_2_on();
+#ifdef RGBLIGHT_COLOR_LAYER_2
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
+#endif
+ break;
+ case 3:
+ ergodox_right_led_3_on();
+#ifdef RGBLIGHT_COLOR_LAYER_3
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
+#endif
+ break;
+ case 4:
+ ergodox_right_led_1_on();
+ ergodox_right_led_2_on();
+#ifdef RGBLIGHT_COLOR_LAYER_4
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
+#endif
+ break;
+ case 5:
+ ergodox_right_led_1_on();
+ ergodox_right_led_3_on();
+#ifdef RGBLIGHT_COLOR_LAYER_5
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
+#endif
+ break;
+ case 6:
+ ergodox_right_led_2_on();
+ ergodox_right_led_3_on();
+#ifdef RGBLIGHT_COLOR_LAYER_6
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
+#endif
+ break;
+ case 7:
+ ergodox_right_led_1_on();
+ ergodox_right_led_2_on();
+ ergodox_right_led_3_on();
+#ifdef RGBLIGHT_COLOR_LAYER_7
+ rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7);
+#endif
+ break;
+ default:
+ break;
}
- return state;
+ return state;
};