diff options
Diffstat (limited to 'keyboards/eco/keymaps')
-rw-r--r-- | keyboards/eco/keymaps/xyverz/keymap.c | 115 |
1 files changed, 39 insertions, 76 deletions
diff --git a/keyboards/eco/keymaps/xyverz/keymap.c b/keyboards/eco/keymaps/xyverz/keymap.c index 395a014acb..5a1974336a 100644 --- a/keyboards/eco/keymaps/xyverz/keymap.c +++ b/keyboards/eco/keymaps/xyverz/keymap.c @@ -1,36 +1,13 @@ -// This is the canonical layout file for the Quantum project. If you want to add another keyboard, -// this is the style you want to emulate. - -// Default ECO Layout -// KLE here : http://www.keyboard-layout-editor.com/#/gists/0733eca6b4cb88ff9d7de746803f4039 - #include QMK_KEYBOARD_H -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - BACKLIT -}; +enum layer_names { _QWERTY, _COLEMAK, _DVORAK, _LOWER, _RAISE, _ADJUST }; -// Aliases to make reading the keymap easier -#define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. +enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, LOWER, RAISE, ADJUST }; +// Aliases to keep the keymap tidy +#define GUIBSPC GUI_T(KC_BSPC) // GUI when held, BSPC when tapped. + +// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -143,53 +120,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; +// clang-format on + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void matrix_init_user(void) { +#ifdef BOOTLOADER_CATERINA + // This will disable the red LEDs on the ProMicros + setPinInput(D5); + writePinLow(D5); + setPinInput(B0); + writePinLow(B0); +#endif +}; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} +layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - return true; -} - + if (record->event.pressed) { + switch (keycode) { + case QWERTY: + set_single_persistent_default_layer(_QWERTY); + return false; + case COLEMAK: + set_single_persistent_default_layer(_COLEMAK); + return false; + case DVORAK: + set_single_persistent_default_layer(_DVORAK); + return false; + } + } + return true; +}
\ No newline at end of file |