From aab056a4a6ab838560bf533f79e7be71a3deb02d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 2 Jan 2021 00:52:49 +1100 Subject: Manta60 refactor (#11378) --- keyboards/manta60/keymaps/default/config.h | 2 - keyboards/manta60/keymaps/default/keymap.c | 166 ++++++++++++----------------- 2 files changed, 69 insertions(+), 99 deletions(-) (limited to 'keyboards/manta60/keymaps') diff --git a/keyboards/manta60/keymaps/default/config.h b/keyboards/manta60/keymaps/default/config.h index 55af5473e0..a59b247ded 100644 --- a/keyboards/manta60/keymaps/default/config.h +++ b/keyboards/manta60/keymaps/default/config.h @@ -17,5 +17,3 @@ #pragma once #define RGBLIGHT_SLEEP - -// place overrides here diff --git a/keyboards/manta60/keymaps/default/keymap.c b/keyboards/manta60/keymaps/default/keymap.c index 5e98141b70..f7cafdacdd 100644 --- a/keyboards/manta60/keymaps/default/keymap.c +++ b/keyboards/manta60/keymaps/default/keymap.c @@ -13,119 +13,91 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include QMK_KEYBOARD_H -// Defines names for use in layer keycodes and the keymap -enum layer_number { - _BASE = 0, - _LOWER, - _RAISE, - _ADJUST, +enum layer_names { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST }; -// Defines the keycodes used by our macros in process_record_user enum custom_keycodes { - LOWER = SAFE_RANGE, - RAISE, - ADJUST + LOWER = SAFE_RANGE, + RAISE, + ADJUST }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - //,---------------------------------------------------------------------.,---------------------------------------------------------------------. - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_AT, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_COMM, KC_DOT, KC_H, KC_J, KC_K, KC_L, KC_UP, KC_SCLN, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_SLSH, KC_B, KC_N, KC_M, KC_LEFT, KC_DOWN, KC_RGHT, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - LOWER, XXXXXXX, KC_LALT, KC_LCTRL, KC_SPC, KC_LGUI, KC_ENT, KC_BSPC, KC_DEL, KC_SPC, KC_RCTRL, KC_RALT, XXXXXXX, RAISE - //`---------+----------/\-------+---------+---------+---------+---------/\---------+---------+---------+---------+---------/\--------+----------' - ), + [_BASE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_AT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_COMM, KC_DOT, KC_H, KC_J, KC_K, KC_L, KC_UP, KC_SCLN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_SLSH, KC_B, KC_N, KC_M, KC_LEFT, KC_DOWN, KC_RGHT, + LOWER, XXXXXXX, KC_LALT, KC_LCTL, KC_SPC, KC_LGUI, KC_ENT, KC_BSPC, KC_DEL, KC_SPC, KC_RCTL, KC_RALT, XXXXXXX, RAISE + ), - [_LOWER] = LAYOUT( - //,---------------------------------------------------------------------.,---------------------------------------------------------------------. - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSLS, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - LOWER, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RAISE - //`---------+----------/\-------+---------+---------+---------+---------/\---------+---------+---------+---------+---------/\--------+----------' - ), + [_LOWER] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_JYEN, KC_LBRC, KC_RBRC, + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SCLN, KC_QUOT, KC_BSLS, + _______, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + LOWER, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RAISE + ), - [_RAISE] = LAYOUT( - //,---------------------------------------------------------------------.,---------------------------------------------------------------------. - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - LOWER, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RAISE - //`---------+----------/\-------+---------+---------+---------+---------/\---------+---------+---------+---------+---------/\--------+----------' - ), + [_RAISE] = LAYOUT( + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + LOWER, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RAISE + ), - [_ADJUST] = LAYOUT( - //,---------------------------------------------------------------------.,---------------------------------------------------------------------. - _______, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_M_SN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, RGB_M_T, RGB_HUD, RGB_SAD, RGB_VAD, RGB_M_K, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - _______, RGB_M_P, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_SW, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - //|---------+---------+---------+---------+---------+---------+---------|\---------+---------+---------+---------+---------+---------+---------| - LOWER, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RAISE - //`---------+----------/\-------+---------+---------+---------+---------/\---------+---------+---------+---------+---------/\--------+----------' - ) + [_ADJUST] = LAYOUT( + _______, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + _______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_M_SN,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, RGB_M_T, RGB_HUD, RGB_SAD, RGB_VAD, RGB_M_K, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, RGB_M_P, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_SW, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + LOWER, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RAISE + ) }; static inline void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - layer_on(layer3); - } else { - layer_off(layer3); - } + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + layer_on(layer3); + } else { + layer_off(layer3); + } } bool process_record_user(uint16_t keycode, keyrecord_t *record) { -switch (keycode) { -case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; -case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; -case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; } - return false; - break; - } - return true; + return true; } -- cgit v1.2.3