diff options
author | noroadsleft <18669334+noroadsleft@users.noreply.github.com> | 2018-12-14 21:36:03 -0800 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-12-14 21:36:03 -0800 |
commit | 45591ee443f57000bf5ad39f45bfa5d44f43dce0 (patch) | |
tree | 9a2322770607eb1c7efa17063c4e3f3e45c048fb /keyboards/chimera_ortho/keymaps/gordon | |
parent | 8f790948e5f7ed62b2c56e1a6aa63dae89d5c860 (diff) | |
download | firmware-45591ee443f57000bf5ad39f45bfa5d44f43dce0.tar.gz firmware-45591ee443f57000bf5ad39f45bfa5d44f43dce0.tar.bz2 firmware-45591ee443f57000bf5ad39f45bfa5d44f43dce0.zip |
Keyboard: Chimera Ortho refactor (#4652)
* Layout macro refactor
- Renamed KC_KEYMAP to LAYOUT_kc
- Renamed KEYMAP to LAYOUT
- moved LAYOUT above LAYOUT_kc (Hoping this encourages users to use LAYOUT.)
- updated layout macro name in info.json
- white space changes for readability
* Keymap refactor: default
Default keymap now uses `#include QMK_KEYBOARD_H` and LAYOUT macro (from KC_KEYMAP/LAYOUT_kc). Keymap was also refactored to use process_record_user function instead of deprecated action_get_macro from TMK.
Also moved LONGPRESS_DELAY and LAYER_TOGGLE_DELAY definitions to config.h.
* Keymap refactor: dcompact
- Changed chimera_ortho.h include for QMK_KEYBOARD_H
- Updated layout name on keymap layers
* Coding conventions fix in default keymap
* Keymap refactor: gordon
- Changed chimera_ortho.h include for QMK_KEYBOARD_H
- Removed redundant includes of action_layer.h and process_tap_dance.h (superseded by QMK_KEYBOARD_H)
- Removed redundant definitions for KC_NO and KC_TRNS
- Updated layout name on keymap layers
Diffstat (limited to 'keyboards/chimera_ortho/keymaps/gordon')
-rw-r--r-- | keyboards/chimera_ortho/keymaps/gordon/keymap.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/keyboards/chimera_ortho/keymaps/gordon/keymap.c b/keyboards/chimera_ortho/keymaps/gordon/keymap.c index c6d668f8f..c6766bed3 100644 --- a/keyboards/chimera_ortho/keymaps/gordon/keymap.c +++ b/keyboards/chimera_ortho/keymaps/gordon/keymap.c @@ -1,10 +1,8 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "chimera_ortho.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #include "version.h" -#include "process_keycode/process_tap_dance.h" #include "gordon.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -83,11 +81,9 @@ //#define LAYER_TOGGLE_DELAY 300 // Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_ KC_TRNS +#define KC_ KC_TRNS -/* TODO: +/* TODO: * * DONE: RESET and CAD into macro layer. * DONE: WINUP AND WINDOWN in NAV layer @@ -113,7 +109,7 @@ * Russain layer * Hebrew layer * Get rid of stupid git pull and push macros. - * + * */ //Tap dance enums @@ -127,14 +123,14 @@ enum { CALC_PRINTSCREEN }; -static xtap ttt_state = { +static xtap ttt_state = { .is_press_action = true, .state = 0 }; //Already exists in gordon.c, shouldn't need this anymore -/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. +/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. // This tap dance favors keys that are used frequently in typing like 'f' int cur_dance (qk_tap_dance_state_t *state) { if (state->count == 1) { @@ -151,8 +147,8 @@ int cur_dance (qk_tap_dance_state_t *state) { else if (state->count == 2) { if (state->interrupted) return DOUBLE_SINGLE_TAP; else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } + else return DOUBLE_TAP; + } else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; else if (state->count == 3) return TRIPLE_HOLD; else return 8; //magic number. At some point this method will expand to work for more presses @@ -194,7 +190,7 @@ void TTT_reset (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_action_t tap_dance_actions[] = { // simple tap dance - [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), + [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), [CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER), [CALC_PRINTSCREEN] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_PSCR), [ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)), @@ -206,7 +202,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( + [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. MESC, Q ,CSHW,ENAV, R , T ,SPC , CLPS, Y , U ,INAV, O , P ,TTT, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -218,7 +214,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_NUMPAD] = KC_KEYMAP( + [_NUMPAD] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , , ,ASTR, , , , , 7 , 8 , 9 ,ASTR,/**/, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -226,11 +222,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , ,SLSH, , , , , 1 , 2 , 3 ,SLSH, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , 0 + , , , 0 // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_SYMBOLS] = KC_KEYMAP( + [_SYMBOLS] = LAYOUT_kc( //,----+----+-----+----+----+----+----. ,----+----+----+----+----+----+----. ,EXLM, AT ,LCBR,RCBR,HASH, , ,CIRC,AMPR,ASTR,LPRN,RPRN,/**/, //|----+----+-----+----+----+----+----| |----+----+----+----+----+----+----| @@ -242,7 +238,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // \-------------------+----+----+---/ \---+----+----+-------------------/ ), - [_FUNCTION] = KC_KEYMAP( + [_FUNCTION] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. F6F7 ,F1 ,F2 ,F3 ,ALF4,F5 ,F6 , F7 ,F8 ,F9 ,F10 ,F11 ,F12 ,/**/, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -250,11 +246,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_NAV] = KC_KEYMAP( + [_NAV] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , ,SNAPLEFT,/**/,SNAPRIGHT,, , , , , UP , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -262,11 +258,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , ,WORKLEFT, ,WORKRIGHT,, , , ,PGUP,PGDN, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CDEL ,DEL, , + CDEL ,DEL, , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_TEXTNAV] = KC_KEYMAP( + [_TEXTNAV] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , , , , , , , , ,/**/, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -274,11 +270,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_MOUSE] = KC_KEYMAP( + [_MOUSE] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , ,MS_UP, , , , , , , UP , , , ,/**/ //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -286,12 +282,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,MS_BTN1 ,MS_BTN2 , + ,MS_BTN1 ,MS_BTN2 , // \------------------+----+----+---/ \---+----+----+-------------------/ - ), + ), - [_MACROS] = KC_KEYMAP( + [_MACROS] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. /**/,RESET,SECRET_2,SECRET_3, , , ,SYSTEM_SLEEP, , ,INCL, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -299,7 +295,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| SCAP, , , , , , , , , , , , ,SCAP, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ) @@ -349,11 +345,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; - + void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); - + switch (layer) { case _QWERTY: set_led_green; @@ -381,7 +377,7 @@ void matrix_scan_user(void) { _delay_ms(45); set_led_blue; _delay_ms(45); - break; + break; default: set_led_green; break; |