diff options
| author | Eric <22215921+ericywl@users.noreply.github.com> | 2018-04-30 23:22:35 +0800 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-04-30 08:22:35 -0700 |
| commit | aade625054643a8b76d58b980fe09087db0fcebd (patch) | |
| tree | d76e5cbf10e3bae62effaf6a19853b2717cff7da | |
| parent | 187d76476ec8bbf066b367956dc3d4f9fdba69a9 (diff) | |
| download | qmk_firmware-aade625054643a8b76d58b980fe09087db0fcebd.tar.gz qmk_firmware-aade625054643a8b76d58b980fe09087db0fcebd.zip | |
QMK Configurator Support for KMAC (#2852)
* Added KMAC Config
* Removed .vscode
| -rw-r--r-- | keyboards/kmac/info.json | 192 | ||||
| -rw-r--r-- | keyboards/kmac/keymaps/default/keymap.c | 101 | ||||
| -rw-r--r-- | keyboards/kmac/keymaps/winkeyless/keymap.c | 101 | ||||
| -rw-r--r-- | keyboards/kmac/kmac.h | 59 | ||||
| -rw-r--r-- | keyboards/kmac/readme.md | 11 |
5 files changed, 329 insertions, 135 deletions
diff --git a/keyboards/kmac/info.json b/keyboards/kmac/info.json new file mode 100644 index 000000000..f86cfdde5 --- /dev/null +++ b/keyboards/kmac/info.json | |||
| @@ -0,0 +1,192 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "kmac", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "qmk", | ||
| 5 | "bootloader": "", | ||
| 6 | "width": 18.25, | ||
| 7 | "height": 6.5, | ||
| 8 | "layouts": { | ||
| 9 | "LAYOUT": { | ||
| 10 | "layout": [ | ||
| 11 | { "label": "Esc", "x": 0, "y": 0 }, | ||
| 12 | { "label": "F1", "x": 2, "y": 0 }, | ||
| 13 | { "label": "F2", "x": 3, "y": 0 }, | ||
| 14 | { "label": "F3", "x": 4, "y": 0 }, | ||
| 15 | { "label": "F4", "x": 5, "y": 0 }, | ||
| 16 | { "label": "F5", "x": 6.5, "y": 0 }, | ||
| 17 | { "label": "F6", "x": 7.5, "y": 0 }, | ||
| 18 | { "label": "F7", "x": 8.5, "y": 0 }, | ||
| 19 | { "label": "F8", "x": 9.5, "y": 0 }, | ||
| 20 | { "label": "F9", "x": 11, "y": 0 }, | ||
| 21 | { "label": "F10", "x": 12, "y": 0 }, | ||
| 22 | { "label": "F11", "x": 13, "y": 0 }, | ||
| 23 | { "label": "F12", "x": 14, "y": 0 }, | ||
| 24 | { "label": "PrtSc", "x": 15.25, "y": 0 }, | ||
| 25 | { "label": "Scroll Lock", "x": 16.25, "y": 0 }, | ||
| 26 | { "label": "Pause", "x": 17.25, "y": 0 }, | ||
| 27 | { "label": "~", "x": 0, "y": 1.5 }, | ||
| 28 | { "label": "!", "x": 1, "y": 1.5 }, | ||
| 29 | { "label": "@", "x": 2, "y": 1.5 }, | ||
| 30 | { "label": "#", "x": 3, "y": 1.5 }, | ||
| 31 | { "label": "$", "x": 4, "y": 1.5 }, | ||
| 32 | { "label": "%", "x": 5, "y": 1.5 }, | ||
| 33 | { "label": "^", "x": 6, "y": 1.5 }, | ||
| 34 | { "label": "&", "x": 7, "y": 1.5 }, | ||
| 35 | { "label": "*", "x": 8, "y": 1.5 }, | ||
| 36 | { "label": "(", "x": 9, "y": 1.5 }, | ||
| 37 | { "label": ")", "x": 10, "y": 1.5 }, | ||
| 38 | { "label": "_", "x": 11, "y": 1.5 }, | ||
| 39 | { "label": "+", "x": 12, "y": 1.5 }, | ||
| 40 | { "label": "Backspace", "x": 13, "y": 1.5, "w": 2 }, | ||
| 41 | { "label": "Insert", "x": 15.25, "y": 1.5 }, | ||
| 42 | { "label": "Home", "x": 16.25, "y": 1.5 }, | ||
| 43 | { "label": "PgUp", "x": 17.25, "y": 1.5 }, | ||
| 44 | { "label": "Tab", "x": 0, "y": 2.5, "w": 1.5 }, | ||
| 45 | { "label": "Q", "x": 1.5, "y": 2.5 }, | ||
| 46 | { "label": "W", "x": 2.5, "y": 2.5 }, | ||
| 47 | { "label": "E", "x": 3.5, "y": 2.5 }, | ||
| 48 | { "label": "R", "x": 4.5, "y": 2.5 }, | ||
| 49 | { "label": "T", "x": 5.5, "y": 2.5 }, | ||
| 50 | { "label": "Y", "x": 6.5, "y": 2.5 }, | ||
| 51 | { "label": "U", "x": 7.5, "y": 2.5 }, | ||
| 52 | { "label": "I", "x": 8.5, "y": 2.5 }, | ||
| 53 | { "label": "O", "x": 9.5, "y": 2.5 }, | ||
| 54 | { "label": "P", "x": 10.5, "y": 2.5 }, | ||
| 55 | { "label": "{", "x": 11.5, "y": 2.5 }, | ||
| 56 | { "label": "}", "x": 12.5, "y": 2.5 }, | ||
| 57 | { "label": "|", "x": 13.5, "y": 2.5, "w": 1.5 }, | ||
| 58 | { "label": "Delete", "x": 15.25, "y": 2.5 }, | ||
| 59 | { "label": "End", "x": 16.25, "y": 2.5 }, | ||
| 60 | { "label": "PgDn", "x": 17.25, "y": 2.5 }, | ||
| 61 | { "label": "Caps Lock", "x": 0, "y": 3.5, "w": 1.75 }, | ||
| 62 | { "label": "A", "x": 1.75, "y": 3.5 }, | ||
| 63 | { "label": "S", "x": 2.75, "y": 3.5 }, | ||
| 64 | { "label": "D", "x": 3.75, "y": 3.5 }, | ||
| 65 | { "label": "F", "x": 4.75, "y": 3.5 }, | ||
| 66 | { "label": "G", "x": 5.75, "y": 3.5 }, | ||
| 67 | { "label": "H", "x": 6.75, "y": 3.5 }, | ||
| 68 | { "label": "J", "x": 7.75, "y": 3.5 }, | ||
| 69 | { "label": "K", "x": 8.75, "y": 3.5 }, | ||
| 70 | { "label": "L", "x": 9.75, "y": 3.5 }, | ||
| 71 | { "label": ":", "x": 10.75, "y": 3.5 }, | ||
| 72 | { "label": "\"", "x": 11.75, "y": 3.5 }, | ||
| 73 | { "label": "Enter", "x": 12.75, "y": 3.5, "w": 2.25 }, | ||
| 74 | { "label": "Shift", "x": 0, "y": 4.5, "w": 2.25 }, | ||
| 75 | { "label": "Z", "x": 2.25, "y": 4.5 }, | ||
| 76 | { "label": "X", "x": 3.25, "y": 4.5 }, | ||
| 77 | { "label": "C", "x": 4.25, "y": 4.5 }, | ||
| 78 | { "label": "V", "x": 5.25, "y": 4.5 }, | ||
| 79 | { "label": "B", "x": 6.25, "y": 4.5 }, | ||
| 80 | { "label": "N", "x": 7.25, "y": 4.5 }, | ||
| 81 | { "label": "M", "x": 8.25, "y": 4.5 }, | ||
| 82 | { "label": "<", "x": 9.25, "y": 4.5 }, | ||
| 83 | { "label": ">", "x": 10.25, "y": 4.5 }, | ||
| 84 | { "label": "?", "x": 11.25, "y": 4.5 }, | ||
| 85 | { "label": "Shift", "x": 12.25, "y": 4.5, "w": 2.75 }, | ||
| 86 | { "label": "\u2191", "x": 16.25, "y": 4.5 }, | ||
| 87 | { "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.25 }, | ||
| 88 | { "label": "Win", "x": 1.25, "y": 5.5, "w": 1.25 }, | ||
| 89 | { "label": "Alt", "x": 2.5, "y": 5.5, "w": 1.25 }, | ||
| 90 | { "x": 3.75, "y": 5.5, "w": 6.25 }, | ||
| 91 | { "label": "Alt", "x": 10, "y": 5.5, "w": 1.25 }, | ||
| 92 | { "label": "Win", "x": 11.25, "y": 5.5, "w": 1.25 }, | ||
| 93 | { "label": "Menu", "x": 12.5, "y": 5.5, "w": 1.25 }, | ||
| 94 | { "label": "Ctrl", "x": 13.75, "y": 5.5, "w": 1.25 }, | ||
| 95 | { "label": "\u2190", "x": 15.25, "y": 5.5 }, | ||
| 96 | { "label": "\u2193", "x": 16.25, "y": 5.5 }, | ||
| 97 | { "label": "\u2192", "x": 17.25, "y": 5.5 } | ||
| 98 | ] | ||
| 99 | }, | ||
| 100 | |||
| 101 | "LAYOUT_WKL": { | ||
| 102 | "layout": [ | ||
| 103 | { "label": "Esc", "x": 0, "y": 0 }, | ||
| 104 | { "label": "F1", "x": 2, "y": 0 }, | ||
| 105 | { "label": "F2", "x": 3, "y": 0 }, | ||
| 106 | { "label": "F3", "x": 4, "y": 0 }, | ||
| 107 | { "label": "F4", "x": 5, "y": 0 }, | ||
| 108 | { "label": "F5", "x": 6.5, "y": 0 }, | ||
| 109 | { "label": "F6", "x": 7.5, "y": 0 }, | ||
| 110 | { "label": "F7", "x": 8.5, "y": 0 }, | ||
| 111 | { "label": "F8", "x": 9.5, "y": 0 }, | ||
| 112 | { "label": "F9", "x": 11, "y": 0 }, | ||
| 113 | { "label": "F10", "x": 12, "y": 0 }, | ||
| 114 | { "label": "F11", "x": 13, "y": 0 }, | ||
| 115 | { "label": "F12", "x": 14, "y": 0 }, | ||
| 116 | { "label": "PrtSc", "x": 15.25, "y": 0 }, | ||
| 117 | { "label": "Scroll Lock", "x": 16.25, "y": 0 }, | ||
| 118 | { "label": "Pause", "x": 17.25, "y": 0 }, | ||
| 119 | { "label": "~", "x": 0, "y": 1.5 }, | ||
| 120 | { "label": "!", "x": 1, "y": 1.5 }, | ||
| 121 | { "label": "@", "x": 2, "y": 1.5 }, | ||
| 122 | { "label": "#", "x": 3, "y": 1.5 }, | ||
| 123 | { "label": "$", "x": 4, "y": 1.5 }, | ||
| 124 | { "label": "%", "x": 5, "y": 1.5 }, | ||
| 125 | { "label": "^", "x": 6, "y": 1.5 }, | ||
| 126 | { "label": "&", "x": 7, "y": 1.5 }, | ||
| 127 | { "label": "*", "x": 8, "y": 1.5 }, | ||
| 128 | { "label": "(", "x": 9, "y": 1.5 }, | ||
| 129 | { "label": ")", "x": 10, "y": 1.5 }, | ||
| 130 | { "label": "_", "x": 11, "y": 1.5 }, | ||
| 131 | { "label": "+", "x": 12, "y": 1.5 }, | ||
| 132 | { "label": "Backspace", "x": 13, "y": 1.5, "w": 2 }, | ||
| 133 | { "label": "Insert", "x": 15.25, "y": 1.5 }, | ||
| 134 | { "label": "Home", "x": 16.25, "y": 1.5 }, | ||
| 135 | { "label": "PgUp", "x": 17.25, "y": 1.5 }, | ||
| 136 | { "label": "Tab", "x": 0, "y": 2.5, "w": 1.5 }, | ||
| 137 | { "label": "Q", "x": 1.5, "y": 2.5 }, | ||
| 138 | { "label": "W", "x": 2.5, "y": 2.5 }, | ||
| 139 | { "label": "E", "x": 3.5, "y": 2.5 }, | ||
| 140 | { "label": "R", "x": 4.5, "y": 2.5 }, | ||
| 141 | { "label": "T", "x": 5.5, "y": 2.5 }, | ||
| 142 | { "label": "Y", "x": 6.5, "y": 2.5 }, | ||
| 143 | { "label": "U", "x": 7.5, "y": 2.5 }, | ||
| 144 | { "label": "I", "x": 8.5, "y": 2.5 }, | ||
| 145 | { "label": "O", "x": 9.5, "y": 2.5 }, | ||
| 146 | { "label": "P", "x": 10.5, "y": 2.5 }, | ||
| 147 | { "label": "{", "x": 11.5, "y": 2.5 }, | ||
| 148 | { "label": "}", "x": 12.5, "y": 2.5 }, | ||
| 149 | { "label": "|", "x": 13.5, "y": 2.5, "w": 1.5 }, | ||
| 150 | { "label": "Delete", "x": 15.25, "y": 2.5 }, | ||
| 151 | { "label": "End", "x": 16.25, "y": 2.5 }, | ||
| 152 | { "label": "PgDn", "x": 17.25, "y": 2.5 }, | ||
| 153 | { "label": "Caps Lock", "x": 0, "y": 3.5, "w": 1.75 }, | ||
| 154 | { "label": "A", "x": 1.75, "y": 3.5 }, | ||
| 155 | { "label": "S", "x": 2.75, "y": 3.5 }, | ||
| 156 | { "label": "D", "x": 3.75, "y": 3.5 }, | ||
| 157 | { "label": "F", "x": 4.75, "y": 3.5 }, | ||
| 158 | { "label": "G", "x": 5.75, "y": 3.5 }, | ||
| 159 | { "label": "H", "x": 6.75, "y": 3.5 }, | ||
| 160 | { "label": "J", "x": 7.75, "y": 3.5 }, | ||
| 161 | { "label": "K", "x": 8.75, "y": 3.5 }, | ||
| 162 | { "label": "L", "x": 9.75, "y": 3.5 }, | ||
| 163 | { "label": ":", "x": 10.75, "y": 3.5 }, | ||
| 164 | { "label": "\"", "x": 11.75, "y": 3.5 }, | ||
| 165 | { "label": "Enter", "x": 12.75, "y": 3.5, "w": 2.25 }, | ||
| 166 | { "label": "Shift", "x": 0, "y": 4.5, "w": 2.25 }, | ||
| 167 | { "label": "Z", "x": 2.25, "y": 4.5 }, | ||
| 168 | { "label": "X", "x": 3.25, "y": 4.5 }, | ||
| 169 | { "label": "C", "x": 4.25, "y": 4.5 }, | ||
| 170 | { "label": "V", "x": 5.25, "y": 4.5 }, | ||
| 171 | { "label": "B", "x": 6.25, "y": 4.5 }, | ||
| 172 | { "label": "N", "x": 7.25, "y": 4.5 }, | ||
| 173 | { "label": "M", "x": 8.25, "y": 4.5 }, | ||
| 174 | { "label": "<", "x": 9.25, "y": 4.5 }, | ||
| 175 | { "label": ">", "x": 10.25, "y": 4.5 }, | ||
| 176 | { "label": "?", "x": 11.25, "y": 4.5 }, | ||
| 177 | { "label": "Shift", "x": 12.25, "y": 4.5, "w": 2.75 }, | ||
| 178 | { "label": "\u2191", "x": 16.25, "y": 4.5 }, | ||
| 179 | { "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.5 }, | ||
| 180 | { "label": "Win", "x": 1.5, "y": 5.5 }, | ||
| 181 | { "label": "Alt", "x": 2.5, "y": 5.5, "w": 1.5 }, | ||
| 182 | { "x": 4, "y": 5.5, "w": 7 }, | ||
| 183 | { "label": "Alt", "x": 11, "y": 5.5, "w": 1.5 }, | ||
| 184 | { "label": "Win", "x": 12.5, "y": 5.5 }, | ||
| 185 | { "label": "Ctrl", "x": 13.5, "y": 5.5, "w": 1.5 }, | ||
| 186 | { "label": "\u2190", "x": 15.25, "y": 5.5 }, | ||
| 187 | { "label": "\u2193", "x": 16.25, "y": 5.5 }, | ||
| 188 | { "label": "\u2192", "x": 17.25, "y": 5.5 } | ||
| 189 | ] | ||
| 190 | } | ||
| 191 | } | ||
| 192 | } | ||
diff --git a/keyboards/kmac/keymaps/default/keymap.c b/keyboards/kmac/keymaps/default/keymap.c index f3ac93abf..8ae8627a0 100644 --- a/keyboards/kmac/keymaps/default/keymap.c +++ b/keyboards/kmac/keymaps/default/keymap.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 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/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "kmac.h" | 16 | #include QMK_KEYBOARD_H |
| 17 | 17 | ||
| 18 | // Helpful defines | 18 | // Helpful defines |
| 19 | #define _______ KC_TRNS | 19 | #define _______ KC_TRNS |
| @@ -26,22 +26,20 @@ | |||
| 26 | #define _FL 1 | 26 | #define _FL 1 |
| 27 | 27 | ||
| 28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 29 | [_BL] = KEYMAP( | 29 | [_BL] = LAYOUT( |
| 30 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \ | 30 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, |
| 31 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ | 31 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, |
| 32 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ | 32 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, |
| 33 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | 33 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, |
| 34 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ | 34 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, |
| 35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ | 35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), |
| 36 | ), | 36 | [_FL] = LAYOUT( |
| 37 | [_FL] = KEYMAP( | 37 | BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, |
| 38 | BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, \ | 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), |
| 43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 44 | ), | ||
| 45 | }; | 43 | }; |
| 46 | 44 | ||
| 47 | const uint16_t PROGMEM fn_actions[] = { | 45 | const uint16_t PROGMEM fn_actions[] = { |
| @@ -51,47 +49,52 @@ const uint16_t PROGMEM fn_actions[] = { | |||
| 51 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | 49 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) |
| 52 | { | 50 | { |
| 53 | // MACRODOWN only works in this function | 51 | // MACRODOWN only works in this function |
| 54 | switch(id) { | 52 | switch (id) |
| 55 | case 0: | 53 | { |
| 56 | if (record->event.pressed) { | 54 | case 0: |
| 57 | SEND_STRING("The"); | 55 | if (record->event.pressed) |
| 58 | return false; | 56 | { |
| 59 | } | 57 | SEND_STRING("The"); |
| 60 | break; | 58 | return false; |
| 61 | case 1: | 59 | } |
| 62 | if (record->event.pressed) { | 60 | break; |
| 63 | SEND_STRING("Custom"); | 61 | case 1: |
| 64 | return false; | 62 | if (record->event.pressed) |
| 65 | } | 63 | { |
| 66 | break; | 64 | SEND_STRING("Custom"); |
| 67 | case 2: | 65 | return false; |
| 68 | if (record->event.pressed) { | 66 | } |
| 69 | SEND_STRING("Keyboard"); | 67 | break; |
| 70 | return false; | 68 | case 2: |
| 71 | } | 69 | if (record->event.pressed) |
| 72 | break; | 70 | { |
| 73 | case 3: | 71 | SEND_STRING("Keyboard"); |
| 74 | if (record->event.pressed) { | 72 | return false; |
| 75 | return MACRO( D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END ); | 73 | } |
| 76 | } | 74 | break; |
| 77 | break; | 75 | case 3: |
| 76 | if (record->event.pressed) | ||
| 77 | { | ||
| 78 | return MACRO(D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END); | ||
| 79 | } | ||
| 80 | break; | ||
| 78 | } | 81 | } |
| 79 | return MACRO_NONE; | 82 | return MACRO_NONE; |
| 80 | }; | 83 | }; |
| 81 | 84 | ||
| 82 | 85 | void matrix_init_user(void) | |
| 83 | void matrix_init_user(void) { | 86 | { |
| 84 | |||
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | void matrix_scan_user(void) { | 89 | void matrix_scan_user(void) |
| 88 | 90 | { | |
| 89 | } | 91 | } |
| 90 | 92 | ||
| 91 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 93 | bool process_record_user(uint16_t keycode, keyrecord_t *record) |
| 94 | { | ||
| 92 | return true; | 95 | return true; |
| 93 | } | 96 | } |
| 94 | 97 | ||
| 95 | void led_set_user(uint8_t usb_led) { | 98 | void led_set_user(uint8_t usb_led) |
| 96 | 99 | { | |
| 97 | } | 100 | } |
diff --git a/keyboards/kmac/keymaps/winkeyless/keymap.c b/keyboards/kmac/keymaps/winkeyless/keymap.c index e3d66ea08..985d5a89f 100644 --- a/keyboards/kmac/keymaps/winkeyless/keymap.c +++ b/keyboards/kmac/keymaps/winkeyless/keymap.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 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/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "kmac.h" | 16 | #include QMK_KEYBOARD_H |
| 17 | 17 | ||
| 18 | // Helpful defines | 18 | // Helpful defines |
| 19 | #define _______ KC_TRNS | 19 | #define _______ KC_TRNS |
| @@ -26,22 +26,20 @@ | |||
| 26 | #define _FL 1 | 26 | #define _FL 1 |
| 27 | 27 | ||
| 28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 29 | [_BL] = KEYMAP_WINKEYLESS( | 29 | [_BL] = LAYOUT_WKL( |
| 30 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \ | 30 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, |
| 31 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ | 31 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, |
| 32 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ | 32 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, |
| 33 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | 33 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, |
| 34 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ | 34 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, |
| 35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ | 35 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), |
| 36 | ), | 36 | [_FL] = LAYOUT_WKL( |
| 37 | [_FL] = KEYMAP_WINKEYLESS( | 37 | BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, |
| 38 | BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, \ | 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | 42 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), |
| 43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 44 | ), | ||
| 45 | }; | 43 | }; |
| 46 | 44 | ||
| 47 | const uint16_t PROGMEM fn_actions[] = { | 45 | const uint16_t PROGMEM fn_actions[] = { |
| @@ -51,47 +49,52 @@ const uint16_t PROGMEM fn_actions[] = { | |||
| 51 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | 49 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) |
| 52 | { | 50 | { |
| 53 | // MACRODOWN only works in this function | 51 | // MACRODOWN only works in this function |
| 54 | switch(id) { | 52 | switch (id) |
| 55 | case 0: | 53 | { |
| 56 | if (record->event.pressed) { | 54 | case 0: |
| 57 | SEND_STRING("The"); | 55 | if (record->event.pressed) |
| 58 | return false; | 56 | { |
| 59 | } | 57 | SEND_STRING("The"); |
| 60 | break; | 58 | return false; |
| 61 | case 1: | 59 | } |
| 62 | if (record->event.pressed) { | 60 | break; |
| 63 | SEND_STRING("Custom"); | 61 | case 1: |
| 64 | return false; | 62 | if (record->event.pressed) |
| 65 | } | 63 | { |
| 66 | break; | 64 | SEND_STRING("Custom"); |
| 67 | case 2: | 65 | return false; |
| 68 | if (record->event.pressed) { | 66 | } |
| 69 | SEND_STRING("Keyboard"); | 67 | break; |
| 70 | return false; | 68 | case 2: |
| 71 | } | 69 | if (record->event.pressed) |
| 72 | break; | 70 | { |
| 73 | case 3: | 71 | SEND_STRING("Keyboard"); |
| 74 | if (record->event.pressed) { | 72 | return false; |
| 75 | return MACRO( D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END ); | 73 | } |
| 76 | } | 74 | break; |
| 77 | break; | 75 | case 3: |
| 76 | if (record->event.pressed) | ||
| 77 | { | ||
| 78 | return MACRO(D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END); | ||
| 79 | } | ||
| 80 | break; | ||
| 78 | } | 81 | } |
| 79 | return MACRO_NONE; | 82 | return MACRO_NONE; |
| 80 | }; | 83 | }; |
| 81 | 84 | ||
| 82 | 85 | void matrix_init_user(void) | |
| 83 | void matrix_init_user(void) { | 86 | { |
| 84 | |||
| 85 | } | 87 | } |
| 86 | 88 | ||
| 87 | void matrix_scan_user(void) { | 89 | void matrix_scan_user(void) |
| 88 | 90 | { | |
| 89 | } | 91 | } |
| 90 | 92 | ||
| 91 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 93 | bool process_record_user(uint16_t keycode, keyrecord_t *record) |
| 94 | { | ||
| 92 | return true; | 95 | return true; |
| 93 | } | 96 | } |
| 94 | 97 | ||
| 95 | void led_set_user(uint8_t usb_led) { | 98 | void led_set_user(uint8_t usb_led) |
| 96 | 99 | { | |
| 97 | } | 100 | } |
diff --git a/keyboards/kmac/kmac.h b/keyboards/kmac/kmac.h index 1d9d8e36b..44de8914a 100644 --- a/keyboards/kmac/kmac.h +++ b/keyboards/kmac/kmac.h | |||
| @@ -19,38 +19,35 @@ | |||
| 19 | #include "quantum.h" | 19 | #include "quantum.h" |
| 20 | 20 | ||
| 21 | // Keymap for the winkey version of the PCB. | 21 | // Keymap for the winkey version of the PCB. |
| 22 | #define KEYMAP( \ | 22 | #define LAYOUT( \ |
| 23 | K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ | 23 | K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ |
| 24 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ | 24 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ |
| 25 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ | 25 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ |
| 26 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ | 26 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ |
| 27 | K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ | 27 | K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ |
| 28 | K50, K51, K52, K55, K58, K5A, K5C, K5D, K5E, K5F, K5G \ | 28 | K50, K51, K52, K55, K58, K5A, K5C, K5D, K5E, K5F, K5G) \ |
| 29 | ) { \ | 29 | { \ |
| 30 | /* 0 1 2 3 4 5 6 7 8 9 A B C D E F G */ \ | 30 | /* 0 1 2 3 4 5 6 7 8 9 A B C D E F G */ \ |
| 31 | /* 0 */ { K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G }, \ | 31 | /* 0 */ {K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G}, \ |
| 32 | /* 1 */ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ | 32 | /* 1 */ {K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G}, \ |
| 33 | /* 2 */ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ | 33 | /* 2 */ {K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G}, \ |
| 34 | /* 3 */ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO, KC_NO, KC_NO }, \ | 34 | /* 3 */ {K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO, KC_NO, KC_NO}, \ |
| 35 | /* 4 */ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, KC_NO, KC_NO, K4D, KC_NO, K4F, KC_NO }, \ | 35 | /* 4 */ {K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, KC_NO, KC_NO, K4D, KC_NO, K4F, KC_NO}, \ |
| 36 | /* 5 */ { K50, K51, K52, KC_NO, KC_NO, K55, KC_NO, KC_NO, K58, KC_NO, K5A, KC_NO, K5C, K5D, K5E, K5F, K5G } \ | 36 | /* 5 */ { K50, K51, K52, KC_NO, KC_NO, K55, KC_NO, KC_NO, K58, KC_NO, K5A, KC_NO, K5C, K5D, K5E, K5F, K5G } \ |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | // Keymap for the winkeyless version of the PCB. | 39 | // Keymap for the winkeyless version of the PCB. |
| 40 | #define KEYMAP_WINKEYLESS( \ | 40 | #define LAYOUT_WKL( \ |
| 41 | K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ | 41 | K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ |
| 42 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ | 42 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ |
| 43 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ | 43 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ |
| 44 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ | 44 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ |
| 45 | K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ | 45 | K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ |
| 46 | K50, K51, K52, K55, K58, K5A, K5D, K5E, K5F, K5G \ | 46 | K50, K51, K52, K55, K58, K5A, K5D, K5E, K5F, K5G) LAYOUT(K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ |
| 47 | ) KEYMAP( \ | 47 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ |
| 48 | K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ | 48 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ |
| 49 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ | 49 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ |
| 50 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ | 50 | K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ |
| 51 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ | 51 | K50, K51, K52, K55, K58, K5A, KC_NO, K5D, K5E, K5F, K5G) |
| 52 | K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4D, K4F, \ | ||
| 53 | K50, K51, K52, K55, K58, K5A, KC_NO, K5D, K5E, K5F, K5G \ | ||
| 54 | ) | ||
| 55 | 52 | ||
| 56 | #endif | 53 | #endif |
diff --git a/keyboards/kmac/readme.md b/keyboards/kmac/readme.md index fccf902ca..ec36c0a5c 100644 --- a/keyboards/kmac/readme.md +++ b/keyboards/kmac/readme.md | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | KMAC keyboard firmware | 1 | # KMAC keyboard firmware |
| 2 | ====================== | ||
| 3 | 2 | ||
| 4 | A Korean custom keyboard designed by Byungho Kim and the KBDMania community. | 3 | A Korean custom keyboard designed by Byungho Kim and the KBDMania community. |
| 5 | 4 | ||
| @@ -37,9 +36,9 @@ To define your own keymap, copy one of the [existing keymap](keymaps) folders an | |||
| 37 | 36 | ||
| 38 | To make it easy to define keymaps for the different versions of the PCB two macros are provided. | 37 | To make it easy to define keymaps for the different versions of the PCB two macros are provided. |
| 39 | 38 | ||
| 40 | | PCB | Macro | | 39 | | PCB | Macro | |
| 41 | | -------------- | --------------------- | | 40 | | -------------- | -------------- | |
| 42 | | Winkey PCB | `KEYMAP()` | | 41 | | Winkey PCB | `LAYOUT()` | |
| 43 | | Winkeyless PCB | `KEYMAP_WINKEYLESS()` | | 42 | | Winkeyless PCB | `LAYOUT_WKL()` | |
| 44 | 43 | ||
| 45 | To build the firmware with a custom keymap, run `make <keymap name>` | 44 | To build the firmware with a custom keymap, run `make <keymap name>` |
