Skip to content

Commit

Permalink
Keymap refactor: gordon
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
noroadsleft committed Dec 15, 2018
1 parent d850eda commit cd836db
Showing 1 changed file with 27 additions and 31 deletions.
58 changes: 27 additions & 31 deletions keyboards/chimera_ortho/keymaps/gordon/keymap.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -113,7 +109,7 @@
* Russain layer
* Hebrew layer
* Get rid of stupid git pull and push macros.
*
*
*/

//Tap dance enums
Expand All @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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)),
Expand All @@ -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,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
Expand All @@ -218,19 +214,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// \------------------+----+----+---/ \---+----+----+-------------------/
),

[_NUMPAD] = KC_KEYMAP(
[_NUMPAD] = LAYOUT_kc(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
, , , ,ASTR, , , , , 7 , 8 , 9 ,ASTR,/**/,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
,MINS,PLUS,/**/,EQUAL, , , , , 4 , 5 , 6 ,PLUS, ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , ,SLSH, , , , , 1 , 2 , 3 ,SLSH, ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , 0
, , , 0
// \------------------+----+----+---/ \---+----+----+-------------------/
),

[_SYMBOLS] = KC_KEYMAP(
[_SYMBOLS] = LAYOUT_kc(
//,----+----+-----+----+----+----+----. ,----+----+----+----+----+----+----.
,EXLM, AT ,LCBR,RCBR,HASH, , ,CIRC,AMPR,ASTR,LPRN,RPRN,/**/,
//|----+----+-----+----+----+----+----| |----+----+----+----+----+----+----|
Expand All @@ -242,64 +238,64 @@ 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 ,/**/,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , ,
, , ,
// \------------------+----+----+---/ \---+----+----+-------------------/
),

[_NAV] = KC_KEYMAP(
[_NAV] = LAYOUT_kc(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
, ,SNAPLEFT,/**/,SNAPRIGHT,, , , , , UP , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
,SNAPUP,PREVTAB, ,NEXTTAB,SNAPDOWN,, , ,LEFT,DOWN,RGHT, , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, ,WORKLEFT, ,WORKRIGHT,, , , ,PGUP,PGDN, , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
CDEL ,DEL, ,
CDEL ,DEL, ,
// \------------------+----+----+---/ \---+----+----+-------------------/
),

[_TEXTNAV] = KC_KEYMAP(
[_TEXTNAV] = LAYOUT_kc(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
, , , , , , , , , ,/**/, , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , ,
, , ,
// \------------------+----+----+---/ \---+----+----+-------------------/
),

[_MOUSE] = KC_KEYMAP(
[_MOUSE] = LAYOUT_kc(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
, , ,MS_UP, , , , , , , UP , , , ,/**/
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, ,MS_LEFT,MS_DOWN,MS_RIGHT, , , , ,LEFT,DOWN,RGHT,/**/, ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
,MS_BTN1 ,MS_BTN2 ,
,MS_BTN1 ,MS_BTN2 ,
// \------------------+----+----+---/ \---+----+----+-------------------/
),
),


[_MACROS] = KC_KEYMAP(
[_MACROS] = LAYOUT_kc(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
/**/,RESET,SECRET_2,SECRET_3, , , ,SYSTEM_SLEEP, , ,INCL, , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
CAD ,SECRET_1, , , , , , , , , , , , ,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
SCAP, , , , , , , , , , , , ,SCAP,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
, , ,
, , ,
// \------------------+----+----+---/ \---+----+----+-------------------/
)

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cd836db

Please sign in to comment.