diff options
-rw-r--r-- | keyboards/packrat/config.h | 59 | ||||
-rw-r--r-- | keyboards/packrat/info.json | 26 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/3uc/config.h | 19 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/3uc/keymap.c | 92 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/3uc/readme.md | 1 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/3uc/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/default/config.h | 19 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/default/keymap.c | 81 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/default/readme.md | 3 | ||||
-rw-r--r-- | keyboards/packrat/keymaps/default/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/packrat/packrat.c | 28 | ||||
-rw-r--r-- | keyboards/packrat/packrat.h | 79 | ||||
-rw-r--r-- | keyboards/packrat/readme.md | 25 | ||||
-rw-r--r-- | keyboards/packrat/rules.mk | 23 |
14 files changed, 457 insertions, 0 deletions
diff --git a/keyboards/packrat/config.h b/keyboards/packrat/config.h new file mode 100644 index 000000000..c69ecdafc --- /dev/null +++ b/keyboards/packrat/config.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 | #pragma once | ||
17 | |||
18 | #include "config_common.h" | ||
19 | |||
20 | /* USB Device descriptor parameter */ | ||
21 | #define MANUFACTURER DrHigsby | ||
22 | #define PRODUCT Packrat | ||
23 | #define VENDOR_ID 0x0007 | ||
24 | #define PRODUCT_ID 0x0004 | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | |||
27 | /* key matrix size */ | ||
28 | #define MATRIX_ROWS 4 | ||
29 | #define MATRIX_COLS 11 | ||
30 | |||
31 | /* | ||
32 | * Keyboard Matrix Assignments | ||
33 | * | ||
34 | * Change this to how you wired your keyboard | ||
35 | * COLS: AVR pins used for columns, left to right | ||
36 | * ROWS: AVR pins used for rows, top to bottom | ||
37 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
38 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
39 | * | ||
40 | */ | ||
41 | |||
42 | /* key matrix pins */ | ||
43 | #define MATRIX_ROW_PINS { F7, B1, B6, B2 } | ||
44 | #define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4, B5, B3 } | ||
45 | #define UNUSED_PINS { F6 } | ||
46 | |||
47 | /* COL2ROW or ROW2COL */ | ||
48 | #define DIODE_DIRECTION COL2ROW | ||
49 | |||
50 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
51 | #define DEBOUNCE 5 | ||
52 | |||
53 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
54 | #define LOCKING_SUPPORT_ENABLE | ||
55 | /* Locking resynchronize hack */ | ||
56 | #define LOCKING_RESYNC_ENABLE | ||
57 | |||
58 | #define ENCODERS_PAD_A { F5 } | ||
59 | #define ENCODERS_PAD_B { F4 } | ||
diff --git a/keyboards/packrat/info.json b/keyboards/packrat/info.json new file mode 100644 index 000000000..e4e3d869f --- /dev/null +++ b/keyboards/packrat/info.json | |||
@@ -0,0 +1,26 @@ | |||
1 | { | ||
2 | "keyboard_name": "packrat", | ||
3 | "url": "http://www.keyboard-layout-editor.com/#/gists/43d838a3b2e0344d75dd67abfc508038", | ||
4 | "maintainer": "drhigsby", | ||
5 | "layouts": { | ||
6 | "LAYOUT_3uc": { | ||
7 | "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"KNOB!", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Any", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":":", "x":10, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Any", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"Ctrl", "x":0.5, "y":3, "w":1.25}, {"label":"Alt", "x":1.75, "y":3, "w":1.25}, {"label":"Raise", "x":3, "y":3}, {"label":"", "x":4, "y":3, "w":3}, {"label":"Lower", "x":7, "y":3}, {"label":"Win", "x":8, "y":3, "w":1.25}, {"label":"Fn", "x":9.25, "y":3, "w":1.25}] | ||
8 | }, | ||
9 | |||
10 | "LAYOUT_2x2uc": { | ||
11 | "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"KNOB!", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Any", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":":", "x":10, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Any", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"Ctrl", "x":0.5, "y":3, "w":1.25}, {"label":"Alt", "x":1.75, "y":3, "w":1.25}, {"label":"", "x":3, "y":3, "w":2}, {"label":"Any", "x":5, "y":3}, {"label":"", "x":6, "y":3, "w":2}, {"label":"Win", "x":8, "y":3, "w":1.25}, {"label":"Fn", "x":9.25, "y":3, "w":1.25}] | ||
12 | }, | ||
13 | |||
14 | "LAYOUT_7uc": { | ||
15 | "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"KNOB!", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Any", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":":", "x":10, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Any", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"Ctrl", "x":0.5, "y":3, "w":1.5}, {"label":"", "x":2, "y":3, "w":7}, {"label":"Alt", "x":9, "y":3, "w":1.5}] | ||
16 | }, | ||
17 | |||
18 | "LAYOUT_2x3uc": { | ||
19 | "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"KNOB!", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Any", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":":", "x":10, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Any", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"Ctrl", "x":0.5, "y":3}, {"label":"Alt", "x":1.5, "y":3}, {"label":"", "x":2.5, "y":3, "w":3}, {"label":"", "x":5.5, "y":3, "w":3}, {"label":"Win", "x":8.5, "y":3}, {"label":"Fn", "x":9.5, "y":3}] | ||
20 | }, | ||
21 | |||
22 | "LAYOUT_6uc": { | ||
23 | "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"KNOB!", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"Any", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":":", "x":10, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"Any", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":"<", "x":8, "y":2}, {"label":">", "x":9, "y":2}, {"label":"?", "x":10, "y":2}, {"label":"Ctrl", "x":0.5, "y":3}, {"label":"Alt", "x":1.5, "y":3}, {"label":"", "x":2.5, "y":3, "w":6}, {"label":"Win", "x":8.5, "y":3}, {"label":"Fn", "x":9.5, "y":3}] | ||
24 | } | ||
25 | } | ||
26 | } | ||
diff --git a/keyboards/packrat/keymaps/3uc/config.h b/keyboards/packrat/keymaps/3uc/config.h new file mode 100644 index 000000000..9ff2d89ac --- /dev/null +++ b/keyboards/packrat/keymaps/3uc/config.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 | #pragma once | ||
17 | |||
18 | #define COMBO_COUNT 7 | ||
19 | #define COMBO_TERM 40 | ||
diff --git a/keyboards/packrat/keymaps/3uc/keymap.c b/keyboards/packrat/keymaps/3uc/keymap.c new file mode 100644 index 000000000..f037a47ac --- /dev/null +++ b/keyboards/packrat/keymaps/3uc/keymap.c | |||
@@ -0,0 +1,92 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 layers{ | ||
20 | _BASE, | ||
21 | _CODE, | ||
22 | _MATH, | ||
23 | _FUNC | ||
24 | }; | ||
25 | |||
26 | enum combo_events { | ||
27 | combo_ESC, | ||
28 | combo_BACK, | ||
29 | combo_TAB, | ||
30 | combo_DELETE, | ||
31 | combo_ENTER, | ||
32 | combo_LPRN, | ||
33 | combo_RPRN, | ||
34 | }; | ||
35 | |||
36 | const uint16_t PROGMEM esc_combo[] = {KC_Q, KC_W, COMBO_END}; | ||
37 | const uint16_t PROGMEM bspc_combo[] = {KC_O, KC_P, COMBO_END}; | ||
38 | const uint16_t PROGMEM tab_combo[] = {KC_A, KC_S, COMBO_END}; | ||
39 | const uint16_t PROGMEM del_combo[] = {KC_I, KC_O, COMBO_END}; | ||
40 | const uint16_t PROGMEM enter_combo[] = {KC_L, KC_SCLN, COMBO_END}; | ||
41 | const uint16_t PROGMEM lprn_combo[] = {KC_X, KC_C, COMBO_END}; | ||
42 | const uint16_t PROGMEM rprn_combo[] = {KC_COMM, KC_DOT, COMBO_END}; | ||
43 | |||
44 | |||
45 | combo_t key_combos[COMBO_COUNT] = { | ||
46 | [combo_ESC] = COMBO(esc_combo, KC_ESC), | ||
47 | [combo_BACK] = COMBO(bspc_combo, KC_BSPC), | ||
48 | [combo_TAB] = COMBO(tab_combo, KC_TAB), | ||
49 | [combo_DELETE] = COMBO(del_combo, KC_DEL), | ||
50 | [combo_ENTER] = COMBO(enter_combo, KC_ENT), | ||
51 | [combo_LPRN] = COMBO(lprn_combo, KC_LPRN), | ||
52 | [combo_RPRN] = COMBO(rprn_combo, KC_RPRN), | ||
53 | }; | ||
54 | |||
55 | #define BASE TO(_BASE) | ||
56 | #define CODE MO(_CODE) | ||
57 | #define MATH TG(_MATH) | ||
58 | #define FUNC MO(_FUNC) | ||
59 | #define xxx KC_TRNS | ||
60 | |||
61 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
62 | [_BASE] = LAYOUT_3uc( | ||
63 | KC_Q, KC_W, KC_E, KC_R, KC_T, MATH, KC_Y, KC_U, KC_I, KC_O, KC_P, | ||
64 | KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_H, KC_J, KC_K, KC_L, KC_SCLN, | ||
65 | LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), | ||
66 | KC_LALT, KC_LCTL, CODE, KC_SPC, CODE, KC_RGUI, FUNC | ||
67 | ), | ||
68 | |||
69 | [_CODE] = LAYOUT_3uc( | ||
70 | KC_1, KC_2, KC_3, KC_4, KC_5, xxx, KC_6, KC_7, KC_8, KC_9, KC_0, | ||
71 | KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_PGUP, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, | ||
72 | KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, xxx, KC_PGDN, xxx, KC_PIPE, KC_BSLS, KC_DQUO, KC_QUOT, | ||
73 | xxx, xxx, xxx, xxx, xxx, KC_PGUP, KC_PGDN | ||
74 | ), | ||
75 | |||
76 | [_MATH] = LAYOUT_3uc( | ||
77 | xxx, xxx, xxx, xxx, xxx, BASE, xxx, KC_P7, KC_P8, KC_P9, KC_PPLS, | ||
78 | xxx, xxx, xxx, xxx, xxx, xxx, xxx, KC_P4, KC_P5, KC_P6, KC_PCMM, | ||
79 | xxx, xxx, xxx, xxx, xxx, xxx, xxx, KC_P1, KC_P2, KC_P3, KC_PEQL, | ||
80 | xxx, xxx, xxx, xxx, KC_P0, KC_PDOT, KC_PENT | ||
81 | |||
82 | ), | ||
83 | |||
84 | [_FUNC] = LAYOUT_3uc( | ||
85 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, xxx, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, | ||
86 | xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, KC_F11, KC_F12, | ||
87 | xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, | ||
88 | xxx, xxx, xxx, xxx, xxx, xxx, xxx | ||
89 | ) | ||
90 | |||
91 | }; | ||
92 | |||
diff --git a/keyboards/packrat/keymaps/3uc/readme.md b/keyboards/packrat/keymaps/3uc/readme.md new file mode 100644 index 000000000..603f82a81 --- /dev/null +++ b/keyboards/packrat/keymaps/3uc/readme.md | |||
@@ -0,0 +1 @@ | |||
# Centered 3uC Packrat Keymap | |||
diff --git a/keyboards/packrat/keymaps/3uc/rules.mk b/keyboards/packrat/keymaps/3uc/rules.mk new file mode 100644 index 000000000..ab1e43818 --- /dev/null +++ b/keyboards/packrat/keymaps/3uc/rules.mk | |||
@@ -0,0 +1 @@ | |||
COMBO_ENABLE = yes | |||
diff --git a/keyboards/packrat/keymaps/default/config.h b/keyboards/packrat/keymaps/default/config.h new file mode 100644 index 000000000..9ff2d89ac --- /dev/null +++ b/keyboards/packrat/keymaps/default/config.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 | #pragma once | ||
17 | |||
18 | #define COMBO_COUNT 7 | ||
19 | #define COMBO_TERM 40 | ||
diff --git a/keyboards/packrat/keymaps/default/keymap.c b/keyboards/packrat/keymaps/default/keymap.c new file mode 100644 index 000000000..74df6a73e --- /dev/null +++ b/keyboards/packrat/keymaps/default/keymap.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 layers{ | ||
20 | _BASE, | ||
21 | _CODE, | ||
22 | _FUNC | ||
23 | }; | ||
24 | |||
25 | enum combo_events { | ||
26 | combo_ESC, | ||
27 | combo_BACK, | ||
28 | combo_TAB, | ||
29 | combo_DELETE, | ||
30 | combo_ENTER, | ||
31 | combo_LPRN, | ||
32 | combo_RPRN, | ||
33 | }; | ||
34 | |||
35 | const uint16_t PROGMEM esc_combo[] = {KC_Q, KC_W, COMBO_END}; | ||
36 | const uint16_t PROGMEM bspc_combo[] = {KC_O, KC_P, COMBO_END}; | ||
37 | const uint16_t PROGMEM tab_combo[] = {KC_A, KC_S, COMBO_END}; | ||
38 | const uint16_t PROGMEM del_combo[] = {KC_I, KC_O, COMBO_END}; | ||
39 | const uint16_t PROGMEM enter_combo[] = {KC_L, KC_SCLN, COMBO_END}; | ||
40 | const uint16_t PROGMEM lprn_combo[] = {KC_X, KC_C, COMBO_END}; | ||
41 | const uint16_t PROGMEM rprn_combo[] = {KC_COMM, KC_DOT, COMBO_END}; | ||
42 | |||
43 | |||
44 | combo_t key_combos[COMBO_COUNT] = { | ||
45 | [combo_ESC] = COMBO(esc_combo, KC_ESC), | ||
46 | [combo_BACK] = COMBO(bspc_combo, KC_BSPC), | ||
47 | [combo_TAB] = COMBO(tab_combo, KC_TAB), | ||
48 | [combo_DELETE] = COMBO(del_combo, KC_DEL), | ||
49 | [combo_ENTER] = COMBO(enter_combo, KC_ENT), | ||
50 | [combo_LPRN] = COMBO(lprn_combo, KC_LPRN), | ||
51 | [combo_RPRN] = COMBO(rprn_combo, KC_RPRN), | ||
52 | }; | ||
53 | |||
54 | #define CODE MO(_CODE) | ||
55 | #define FUNC MO(_FUNC) | ||
56 | #define xxx KC_TRNS | ||
57 | |||
58 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
59 | [_BASE] = LAYOUT_2x3uc( | ||
60 | KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P, | ||
61 | KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_H, KC_J, KC_K, KC_L, KC_SCLN, | ||
62 | LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), | ||
63 | KC_LCTL, KC_LALT, CODE, KC_SPC, KC_RGUI, FUNC | ||
64 | ), | ||
65 | |||
66 | [_CODE] = LAYOUT_2x3uc( | ||
67 | KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, KC_6, KC_7, KC_8, KC_9, KC_0, | ||
68 | KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CAPS, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, | ||
69 | KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, xxx, xxx, xxx, KC_PIPE, KC_BSLS, KC_DQUO, KC_QUOT, | ||
70 | xxx, xxx, xxx, xxx, KC_PGUP, KC_PGDN | ||
71 | ), | ||
72 | |||
73 | [_FUNC] = LAYOUT_2x3uc( | ||
74 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, xxx, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, | ||
75 | xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, KC_F11, KC_F12, | ||
76 | xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, xxx, | ||
77 | xxx, xxx, xxx, xxx, xxx, xxx | ||
78 | ) | ||
79 | |||
80 | }; | ||
81 | |||
diff --git a/keyboards/packrat/keymaps/default/readme.md b/keyboards/packrat/keymaps/default/readme.md new file mode 100644 index 000000000..3e6ed27b5 --- /dev/null +++ b/keyboards/packrat/keymaps/default/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # Default Packrat Keymap | ||
2 | |||
3 | The default Packrat Keymap uses the 2x3uC layout. | ||
diff --git a/keyboards/packrat/keymaps/default/rules.mk b/keyboards/packrat/keymaps/default/rules.mk new file mode 100644 index 000000000..ab1e43818 --- /dev/null +++ b/keyboards/packrat/keymaps/default/rules.mk | |||
@@ -0,0 +1 @@ | |||
COMBO_ENABLE = yes | |||
diff --git a/keyboards/packrat/packrat.c b/keyboards/packrat/packrat.c new file mode 100644 index 000000000..0f4a47995 --- /dev/null +++ b/keyboards/packrat/packrat.c | |||
@@ -0,0 +1,28 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 | #include "packrat.h" | ||
17 | |||
18 | bool encoder_update_kb(uint8_t index, bool clockwise) { | ||
19 | if (!encoder_update_user(index, clockwise)) { return false; } | ||
20 | if (index == 0) { | ||
21 | if (clockwise) { | ||
22 | tap_code_delay(KC_VOLU, 10); | ||
23 | } else { | ||
24 | tap_code_delay(KC_VOLD, 10); | ||
25 | } | ||
26 | } | ||
27 | return true; | ||
28 | } | ||
diff --git a/keyboards/packrat/packrat.h b/keyboards/packrat/packrat.h new file mode 100644 index 000000000..91d0af7b7 --- /dev/null +++ b/keyboards/packrat/packrat.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* Copyright 2021 drhigsby | ||
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 | #pragma once | ||
18 | |||
19 | #include "quantum.h" | ||
20 | |||
21 | #define LAYOUT_3uc( \ | ||
22 | k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, \ | ||
23 | k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ | ||
24 | k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ | ||
25 | k301, k302, k303, k305, k307, k308, k309 \ | ||
26 | ) { \ | ||
27 | { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010 }, \ | ||
28 | { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110 }, \ | ||
29 | { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210 }, \ | ||
30 | { KC_NO, k301, k302, k303, KC_NO, k305, KC_NO, k307, k308, k309 } \ | ||
31 | } | ||
32 | |||
33 | #define LAYOUT_2x2uc( \ | ||
34 | k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, \ | ||
35 | k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ | ||
36 | k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ | ||
37 | k301, k302, k303, k305, k307, k308, k309 \ | ||
38 | ) { \ | ||
39 | { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010 }, \ | ||
40 | { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110 }, \ | ||
41 | { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210 }, \ | ||
42 | { KC_NO, k301, k302, k303, KC_NO, k305, KC_NO, k307, k308, k309 } \ | ||
43 | } | ||
44 | |||
45 | #define LAYOUT_7uc( \ | ||
46 | k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, \ | ||
47 | k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ | ||
48 | k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ | ||
49 | k301, k305, k309 \ | ||
50 | ) { \ | ||
51 | { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010 }, \ | ||
52 | { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110 }, \ | ||
53 | { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210 }, \ | ||
54 | { KC_NO, k301, KC_NO, KC_NO, KC_NO, k305, KC_NO, KC_NO, KC_NO, k309 } \ | ||
55 | } | ||
56 | |||
57 | #define LAYOUT_2x3uc( \ | ||
58 | k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, \ | ||
59 | k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ | ||
60 | k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ | ||
61 | k301, k302, k303, k307, k308, k309 \ | ||
62 | ) { \ | ||
63 | { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010 }, \ | ||
64 | { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110 }, \ | ||
65 | { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210 }, \ | ||
66 | { KC_NO, k301, k302, k303, KC_NO, KC_NO, KC_NO, k307, k308, k309 } \ | ||
67 | } | ||
68 | |||
69 | #define LAYOUT_6uc( \ | ||
70 | k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, \ | ||
71 | k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ | ||
72 | k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ | ||
73 | k301, k302, k305, k308, k309 \ | ||
74 | ) { \ | ||
75 | { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010 }, \ | ||
76 | { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110 }, \ | ||
77 | { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210 }, \ | ||
78 | { KC_NO, k301, k302, KC_NO, KC_NO, k305, KC_NO, KC_NO, k308, k309 } \ | ||
79 | } | ||
diff --git a/keyboards/packrat/readme.md b/keyboards/packrat/readme.md new file mode 100644 index 000000000..a53377f87 --- /dev/null +++ b/keyboards/packrat/readme.md | |||
@@ -0,0 +1,25 @@ | |||
1 | # Packrat | ||
2 | |||
3 |  | ||
4 | |||
5 | Full Gallery: https://imgur.com/gallery/fZklCG6 | ||
6 | |||
7 | Packrat is an 11u wide ortholinear keyboard featuring multiple bottom row options and top-centered rotary encoder support. | ||
8 | |||
9 | * Keyboard Maintainer: [H. Bond](https://github.com/drhigsby) | ||
10 | * Hardware Supported: Packrat (https://github.com/drhigsby/packrat) | ||
11 | * Hardware Availability: cases available at TBD / make your own | ||
12 | |||
13 | Make example for this keyboard (after setting up your build environment): | ||
14 | |||
15 | make packrat:default | ||
16 | |||
17 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
18 | |||
19 | ## Bootloader | ||
20 | |||
21 | Enter the bootloader in 3 ways: | ||
22 | |||
23 | * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard | ||
24 | * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead | ||
25 | * **Keycode in layout**: Press the key mapped to `RESET` if it is available | ||
diff --git a/keyboards/packrat/rules.mk b/keyboards/packrat/rules.mk new file mode 100644 index 000000000..d43cd106b --- /dev/null +++ b/keyboards/packrat/rules.mk | |||
@@ -0,0 +1,23 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | BOOTLOADER = caterina | ||
6 | |||
7 | # Build Options | ||
8 | # change yes to no to disable | ||
9 | # | ||
10 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
13 | CONSOLE_ENABLE = no # Console for debug | ||
14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
17 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
18 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
21 | AUDIO_ENABLE = no # Audio output | ||
22 | LTO_ENABLE = no # Use link time optimization | ||
23 | ENCODER_ENABLE = yes | ||