diff options
Diffstat (limited to 'keyboards/keebio/dsp40/keymaps/default/keymap.c')
-rwxr-xr-x | keyboards/keebio/dsp40/keymaps/default/keymap.c | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/keyboards/keebio/dsp40/keymaps/default/keymap.c b/keyboards/keebio/dsp40/keymaps/default/keymap.c new file mode 100755 index 000000000..e4162d3b4 --- /dev/null +++ b/keyboards/keebio/dsp40/keymaps/default/keymap.c | |||
@@ -0,0 +1,116 @@ | |||
1 | /* Copyright 2021 Danny Nguyen <danny@keeb.io> | ||
2 | |||
3 | This program is free software: you can redistribute it and/or modify | ||
4 | it under the terms of the GNU General Public License as published by | ||
5 | the Free Software Foundation, either version 2 of the License, or | ||
6 | (at your option) any later version. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License | ||
14 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include QMK_KEYBOARD_H | ||
18 | |||
19 | enum custom_layer { | ||
20 | _QWERTY, | ||
21 | _LOWER, | ||
22 | _RAISE, | ||
23 | _ADJUST, | ||
24 | }; | ||
25 | |||
26 | enum custom_keycodes { | ||
27 | QWERTY = SAFE_RANGE, | ||
28 | LOWER, | ||
29 | RAISE, | ||
30 | ADJUST, | ||
31 | }; | ||
32 | |||
33 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
34 | /* Default Layer | ||
35 | * ,-----------------------------------------------------------. | ||
36 | * | Esc| Q | W | E | R | T | Y | U | I | O | P | BS | | ||
37 | * |-----------------------------------------------------------| | ||
38 | * | Tab | A | S | D | F | G | H | J | K | L | Ent | | ||
39 | * |-----------------------------------------------------------| | ||
40 | * | LSft | Z | X | C | V | B | N | M | , | . | /? | | ||
41 | * |-----------------------------------------------------------| | ||
42 | * | LCtl | LGui| LAlt| spc fn0 | spc fn1 |fn2|RAlt|RCtl | | ||
43 | * `-----------------------------------------------------------' | ||
44 | */ | ||
45 | [_QWERTY] = LAYOUT( | ||
46 | KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
47 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, | ||
48 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, | ||
49 | KC_LCTL, KC_LGUI, KC_LALT, LT(_LOWER, KC_SPC), LT(_RAISE, KC_SPC), LT(_ADJUST, KC_LGUI), KC_RALT, KC_RCTL | ||
50 | ), | ||
51 | |||
52 | [_LOWER] = LAYOUT( | ||
53 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, | ||
54 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, | ||
55 | KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),BL_TOGG, BL_INC, BL_DEC, | ||
56 | _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
57 | ), | ||
58 | |||
59 | [_RAISE] = LAYOUT( | ||
60 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
61 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, | ||
62 | KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, KC_DEL, | ||
63 | _______, KC_TRNS, _______, KC_TRNS, KC_TRNS, _______, _______, RGB_TOG | ||
64 | ), | ||
65 | |||
66 | [_ADJUST] = LAYOUT( | ||
67 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, | ||
68 | _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, | ||
69 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
70 | _______, _______, _______, _______, _______, _______, _______, _______ | ||
71 | ) | ||
72 | }; | ||
73 | |||
74 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
75 | switch (keycode) { | ||
76 | case LOWER: | ||
77 | if (record->event.pressed) { | ||
78 | layer_on(_LOWER); | ||
79 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
80 | } else { | ||
81 | layer_off(_LOWER); | ||
82 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
83 | } | ||
84 | return false; | ||
85 | break; | ||
86 | case RAISE: | ||
87 | if (record->event.pressed) { | ||
88 | layer_on(_RAISE); | ||
89 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
90 | } else { | ||
91 | layer_off(_RAISE); | ||
92 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
93 | } | ||
94 | return false; | ||
95 | break; | ||
96 | case ADJUST: | ||
97 | if (record->event.pressed) { | ||
98 | layer_on(_ADJUST); | ||
99 | } else { | ||
100 | layer_off(_ADJUST); | ||
101 | } | ||
102 | return false; | ||
103 | break; | ||
104 | } | ||
105 | return true; | ||
106 | } | ||
107 | |||
108 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
109 | if (index == 0) { | ||
110 | if (clockwise) { | ||
111 | tap_code(KC_VOLU); | ||
112 | } else { | ||
113 | tap_code(KC_VOLD); | ||
114 | } | ||
115 | } | ||
116 | } | ||