aboutsummaryrefslogtreecommitdiffstats
path: root/users/gordon/gordon.h
blob: 548c63049682a8e0acb7cc837fcf8ef518568d47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#ifndef GORDON
#define GORDON

#include "quantum.h"
#include "process_keycode/process_tap_dance.h"


// Fillers to make layering more clear
#define _______ KC_TRNS
#define ________ KC_TRNS
#define _________ KC_TRNS
#define XXXXXXX KC_NO

// KC codes that are too long
#define DOLLAR KC_DOLLAR
#define LSQUIGLY KC_LBRACKET
#define RSQUIGLY KC_RBRACKET
#define NUMLOCK KC_NUMLOCK
#define CAPLOCK KC_CAPSLOCK
#define BK_SLASH KC_BSLASH
#define ASTERSK KC_KP_ASTERISK
 
// Navigation
#define SNAPLEFT  LGUI(KC_LEFT)
#define SNAPRGHT  LGUI(KC_RIGHT)
#define SNAPUP    LGUI(KC_UP)
#define SNAPDOWN  LGUI(KC_DOWN)
#define PREVTAB   LCTL(LSFT(KC_TAB))
#define NEXTTAB   LCTL(KC_TAB)
#define WORKRIGHT LCTL(LGUI(KC_RIGHT))
#define WORKLEFT  LCTL(LGUI(KC_LEFT))

// KC/modifier hold
#define CTRL_F   CTL_T(KC_F)
#define CTRL_J   CTL_T(KC_J)
#define CTRL_Z   CTL_T(KC_Z)
#define ALT_V    ALT_T(KC_V)
#define ALT_M    ALT_T(KC_M)
#define WIN_G    GUI_T(KC_G)
#define WIN_H    GUI_T(KC_H)
#define HYPER_X  ALL_T(KC_X)
#define HYPE_DOT ALL_T(KC_DOT)
#define MEH_S    MEH_T(KC_S)
#define MEH_L    MEH_T(KC_L)
#define ALT_HOME ALT_T(KC_HOME)


// KC/Layer Hold
#define NAV_E    LT(_NAV,KC_E)
#define NUMPAD_D LT(_NUMPAD,KC_D)
#define MOUSE_C  LT(_MOUSE,KC_C)
#define SYMB_BSP LT(_SYMBOLS,KC_BSPACE)
#define COL_MOUS LT(_MOUSE,KC_SCOLON)
#define SPAC_SYM LT(_SYMBOLS,KC_SPACE)

// Double Modifier ONLY hold
#define ALT_SHFT LSFT(KC_LALT)
#define CTR_SHFT LSFT(KC_LCTL)

// KC/Double modifier Hold
#define CTR_SH_W MT(MOD_LCTL|MOD_LSFT,KC_W)
#define CTR_AL_R MT(MOD_LCTL|MOD_LALT,KC_R)

//MISC
#define PRINTSCR KC_PSCREEN
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))


typedef struct {
  bool is_press_action;
  int state;
} xtap;

enum {
  SINGLE_TAP = 1,
  SINGLE_HOLD = 2,
  DOUBLE_TAP = 3,
  DOUBLE_HOLD = 4,
  DOUBLE_SINGLE_TAP = 5, //send two single taps
  TRIPLE_TAP = 6,
  TRIPLE_HOLD = 7
};

enum gordon_layers
{
  _QWERTY = 0,
  _SYMBOLS,
  _MOUSE,
  _NUMPAD,
  _NAV,
  _MACROS,
  _FUNCTION,
  _TEXTNAV
};



void register_hyper (void);
void unregister_hyper (void);

void register_ctrl_a (void); 
void unregister_ctrl_a (void); 

void register_alt_f7 (void); 
void unregister_alt_f7 (void);

void register_shift_f6 (void); 
void unregister_shift_f6 (void); 

void register_ctrl_shift (void); 
void unregister_ctrl_shift (void); 

void register_alt_shift (void); 
void unregister_alt_shift (void);

int cur_dance (qk_tap_dance_state_t *state); 
int hold_cur_dance (qk_tap_dance_state_t *state); 

void x_finished (qk_tap_dance_state_t *state, void *user_data);
void x_reset (qk_tap_dance_state_t *state, void *user_data);

void h_finished (qk_tap_dance_state_t *state, void *user_data);
void h_reset (qk_tap_dance_state_t *state, void *user_data);

void tab_finished (qk_tap_dance_state_t *state, void *user_data);
void tab_reset (qk_tap_dance_state_t *state, void *user_data);

void comma_finished (qk_tap_dance_state_t *state, void *user_data);
void comma_reset (qk_tap_dance_state_t *state, void *user_data);

void bt_finished (qk_tap_dance_state_t *state, void *user_data);
void bt_reset (qk_tap_dance_state_t *state, void *user_data);

// Macro Declarations
enum {
  INFOQM,
  TIL_SLASH,
  DEREF,
  EQRIGHT,
  TILD3,
  TICK3,
  ALTTAB_START,
  ALTTAB_END
};

enum secret_strings {
  KC_SECRET_1 = SAFE_RANGE,
  KC_SECRET_2,
  KC_SECRET_3,
  KC_SECRET_4,
  KC_SECRET_5,
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);

#endif