aboutsummaryrefslogtreecommitdiff
path: root/keyboards/handwired/freoduo/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired/freoduo/keymaps/default/keymap.c')
-rw-r--r--keyboards/handwired/freoduo/keymaps/default/keymap.c189
1 files changed, 189 insertions, 0 deletions
diff --git a/keyboards/handwired/freoduo/keymaps/default/keymap.c b/keyboards/handwired/freoduo/keymaps/default/keymap.c
new file mode 100644
index 000000000..16eeed13f
--- /dev/null
+++ b/keyboards/handwired/freoduo/keymaps/default/keymap.c
@@ -0,0 +1,189 @@
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.
7enum layers {
8 _QWERTY,
9 _LOWER,
10 _RAISE,
11 _ADJUST,
12};
13
14enum custom_keycodes {
15 LOWER = SAFE_RANGE,
16 RAISE,
17 ADJUST,
18};
19
20// Light all LEDs red when caps lock is active. Hard to ignore!
21const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
22 {0, RGBLED_NUM, HSV_RED} // Light all LEDs, starting with LED 0
23);
24// Light all LEDs in green when keyboard layer 1 is active
25const rgblight_segment_t PROGMEM layer_lower[] = RGBLIGHT_LAYER_SEGMENTS(
26 {6, 6, HSV_GREEN}
27);
28// Light all LEDs in blue when keyboard layer 2 is active
29const rgblight_segment_t PROGMEM layer_raise[] = RGBLIGHT_LAYER_SEGMENTS(
30 {6, 6, HSV_MAGENTA}
31);
32// Light all LEDs in yellow when keyboard layer 3 is active
33const rgblight_segment_t PROGMEM layer_adjust[] = RGBLIGHT_LAYER_SEGMENTS(
34 {6, 6, HSV_ORANGE}
35);
36
37
38// Now define the array of layers. Later layers take precedence
39const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
40 my_capslock_layer,
41 layer_lower,
42 layer_raise,
43 layer_adjust
44);
45
46void keyboard_post_init_user(void) {
47 // Enable the LED layers
48 rgblight_layers = my_rgb_layers;
49}
50
51layer_state_t layer_state_set_user(layer_state_t state) {
52 // Both layers will light up if both kb layers are active
53 rgblight_set_layer_state(1, layer_state_cmp(state, 1));
54 rgblight_set_layer_state(2, layer_state_cmp(state, 2));
55 rgblight_set_layer_state(3, layer_state_cmp(state, 3));
56 return state;
57}
58
59bool led_update_user(led_t led_state) {
60 rgblight_set_layer_state(0, led_state.caps_lock);
61 return true;
62}
63
64const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65
66/* QWERTY
67 * ,-----------------------------------------------------------------------------------.
68 * |` ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
69 * | | | | | | | | | | | | |
70 * |------+------+------+------+------+------+------+------+------+------+------+------|
71 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Enter|
72 * | | | | | | | | | | | | |
73 * |------+------+------+------+------+-------------+------+------+------+------+------|
74 * | Caps | A | S | D | F | G | H | J | K | L | ; | " |
75 * | LOWER| | | | | | | | | | | RAISE|
76 * |------+------+------+------+------+------|------+------+------+------+------+------|
77 * | Shift| Z | X | C | V | B | N | M | , | . | Up | ? |
78 * | | | | | | | | | | | | Shift|
79 * |------+------+------+------+------+------+------+------+------+------+------+------|
80 * | Ctrl |ADJUST| Alt | GUI | Space | Backspace | Alt | Left |Down |Right |
81 * | | | | | | | | | | |
82 * `-----------------------------------------------------------------------------------'
83 */
84[_QWERTY] = LAYOUT(
85 KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
86 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
87 LT(_LOWER,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_RAISE, KC_QUOT),
88 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, RSFT_T(KC_SLSH),
89 KC_LCTL, ADJUST, KC_LGUI, KC_LALT, KC_SPC, KC_BSPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT
90),
91
92/* LOWER
93 * ,-----------------------------------------------------------------------------------.
94 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
95 * |------+------+------+------+------+-------------+------+------+------+------+------|
96 * | | | Up | | | | | - | = | [ | ] | \ |
97 * |------+------+------+------+------+------|------+------+------+------+------+------|
98 * | | Left | Down | Right| | | |ISO # |ISO / | | | |
99 * |------+------+------+------+------+------+------+------+------+------+------+------|
100 * | | | | | | | | | | | | |
101 * |------+------+------+------+------+-------------+------+------+------+------+------|
102 * | | | | | | | | | | |
103 * `-----------------------------------------------------------------------------------'
104 */
105[_LOWER] = LAYOUT(
106 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
107 _______, _______, KC_UP, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
108 _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_NUHS, KC_NUBS, _______, _______, _______,
109 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
110 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
111),
112
113/* RAISE
114 * ,-----------------------------------------------------------------------------------.
115 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
116 * |------+------+------+------+------+-------------+------+------+------+------+------|
117 * | Del | | | | | | | _ | + | | \ | | |
118 * |------+------+------+------+------+------|------+------+------+------+------+------|
119 * | | | | | | | |ISO ~ |ISO | | | |Enter |
120 * |------+------+------+------+------+------+------+------+------+------+------+------|
121 * | | | | | | | | | | | | |
122 * |------+------+------+------+------+-------------+------+------+------+------+------|
123 * | | | | | | | | | | |
124 * `-----------------------------------------------------------------------------------'
125 */
126[_RAISE] = LAYOUT(
127 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
128 KC_DEL, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
129 _______, _______, _______, _______, _______, _______, _______, S(KC_NUHS),S(KC_NUBS),_______, _______, _______,
130 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
131 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
132),
133
134/* ADJUST (LOWER + RAISE)
135 * ,-----------------------------------------------------------------------------------.
136 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
137 * |------+------+------+------+------+------+------+------+------+------+------+------|
138 * | Reset|RGB Tg|RGB Md| | | | | | | | | |
139 * |------+------+------+------+------+-------------+------+------+------+------+------|
140 * | |Hue Dn|Hue Up| | | | | | | | | |
141 * |------+------+------+------+------+------+------+------+------+------+------+------|
142 * | |Sat Dn|Sat Up| | | | | | | | | |
143 * |------+------+------+------+------+------+------+------+------+------+------+------|
144 * | |Val Dn|Val Up| | | | | | | |
145 * `-----------------------------------------------------------------------------------'
146 */
147[_ADJUST] = LAYOUT(
148 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
149 RESET , RGB_TOG, RGB_MOD, VLK_TOG, _______, _______, _______, _______, _______, _______, _______, _______,
150 _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
151 _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
152 _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______
153)
154
155};
156
157bool process_record_user(uint16_t keycode, keyrecord_t *record) {
158 switch (keycode) {
159 case LOWER:
160 if (record->event.pressed) {
161 layer_on(_LOWER);
162 update_tri_layer(_LOWER, _RAISE, _ADJUST);
163 } else {
164 layer_off(_LOWER);
165 update_tri_layer(_LOWER, _RAISE, _ADJUST);
166 }
167 return false;
168 break;
169 case RAISE:
170 if (record->event.pressed) {
171 layer_on(_RAISE);
172 update_tri_layer(_LOWER, _RAISE, _ADJUST);
173 } else {
174 layer_off(_RAISE);
175 update_tri_layer(_LOWER, _RAISE, _ADJUST);
176 }
177 return false;
178 break;
179 case ADJUST:
180 if (record->event.pressed) {
181 layer_on(_ADJUST);
182 } else {
183 layer_off(_ADJUST);
184 }
185 return false;
186 break;
187 }
188 return true;
189}