aboutsummaryrefslogtreecommitdiff
path: root/keyboards/boston_meetup/2019/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/boston_meetup/2019/keymaps/default/keymap.c')
-rw-r--r--keyboards/boston_meetup/2019/keymaps/default/keymap.c147
1 files changed, 147 insertions, 0 deletions
diff --git a/keyboards/boston_meetup/2019/keymaps/default/keymap.c b/keyboards/boston_meetup/2019/keymaps/default/keymap.c
new file mode 100644
index 000000000..666624b18
--- /dev/null
+++ b/keyboards/boston_meetup/2019/keymaps/default/keymap.c
@@ -0,0 +1,147 @@
1#include QMK_KEYBOARD_H
2
3// Each layer gets a name for readability, which is then used in the keymap matrix below.
4// The underscores don't mean anything - you can have a layer called STUFF or any other name.
5// Layer names don't all need to be of the same length, obviously, and you can also skip them
6// entirely and just use numbers.
7
8enum custom_layers {
9 _BASE,
10 _LOWER,
11 _RAISE,
12 _ADJUST
13};
14
15enum custom_keycodes {
16 LOWER = SAFE_RANGE,
17 RAISE,
18};
19
20// Custom macros
21#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
22#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl
23#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl
24#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
25// Requires KC_TRNS/_______ for the trigger key in the destination layer
26#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
27#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise
28
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31
32/* Base
33 * ,------.
34 * | Esc |
35 * |------+------+-------------.
36 * | : | 7 | 8 | 9 |
37 * |------+------+------+------|
38 * | RAISE| 4 | 5 | 6 |
39 * |------+------+------+------|
40 * | LOWER| 1 | 2 | 3 |
41 * `---------------------------'
42 */
43[_BASE] = LAYOUT(
44 KC_ESC,
45 KC_COLN, KC_P7, KC_P8, KC_P9,
46 RAISE, KC_P4, KC_P5, KC_P6,
47 LOWER, KC_P1, KC_P2, KC_P3
48),
49
50/* Lower
51 * ,------.
52 * | Nmlk |
53 * |------+------+-------------.
54 * | : | / | * | - |
55 * |------+------+------+------|
56 * | | | = | + |
57 * |------+------+------+------|
58 * | | 0 | . | ENT |
59 * `---------------------------'
60 */
61[_LOWER] = LAYOUT(
62 KC_NLCK,
63 KC_COLN, KC_PSLS, KC_PAST, KC_PMNS,
64 _______, XXXXXXX, KC_EQL, KC_PPLS,
65 _______, KC_P0, KC_PDOT, KC_PENT
66),
67
68/* Raise
69 * ,------.
70 * | Esc |
71 * |------+------+-------------.
72 * |RGB TG|RGB M+|RGB M-| |
73 * |------+------+------+------|
74 * | |RGB H+|RGB S+|RGB V+|
75 * |------+------+------+------|
76 * | ` |RGB H-|RGB S-|RGB V-|
77 * `---------------------------'
78 */
79[_RAISE] = LAYOUT(
80 KC_NLCK,
81 RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX,
82 _______, RGB_HUI, RGB_SAI, RGB_VAI,
83 _______, RGB_HUD, RGB_SAD, RGB_VAD
84
85),
86
87/* Adjust
88 * ,------.
89 * | DFU |
90 * |------+------+-------------.
91 * |HPT TG|HPT FB|HPT RS| BKSP |
92 * |------+------+------+------|
93 * | |HPT M+| | |
94 * |------+------+------+------|
95 * | |HPT M-|Clk TG| Del |
96 * `---------------------------'
97 */
98[_ADJUST] = LAYOUT(
99 RESET,
100 HPT_TOG, HPT_FBK, HPT_RST, KC_BSPC,
101 _______, HPT_MODI, XXXXXXX, XXXXXXX,
102 _______, HPT_MODD, CK_TOGG, KC_DEL
103),
104
105
106};
107
108layer_state_t layer_state_set_user(layer_state_t state) {
109 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
110}
111
112
113bool process_record_user(uint16_t keycode, keyrecord_t *record) {
114 switch (keycode) {
115 case LOWER:
116 if (record->event.pressed) {
117 //not sure how to have keyboard check mode and set it to a variable, so my work around
118 //uses another variable that would be set to true after the first time a reactive key is pressed.
119 layer_on(_LOWER);
120 } else {
121 layer_off(_LOWER);
122 }
123 return false;
124 break;
125 case RAISE:
126 if (record->event.pressed) {
127 //not sure how to have keyboard check mode and set it to a variable, so my work around
128 //uses another variable that would be set to true after the first time a reactive key is pressed.
129 layer_on(_RAISE);
130 } else {
131 layer_off(_RAISE);
132 }
133 return false;
134 break;
135 }
136 return true;
137}
138
139bool music_mask_user(uint16_t keycode) {
140 switch (keycode) {
141 case RAISE:
142 case LOWER:
143 return false;
144 default:
145 return true;
146 }
147}