diff options
author | Joel Challis <git@zvecr.com> | 2021-08-24 17:07:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 17:07:11 +0100 |
commit | 2cade3a48300e0709f8aec68602faf90947b6738 (patch) | |
tree | 20d4e05ccb92ebf35c7aa3ab281590302e9befa9 /data/templates/base/keymaps | |
parent | 2827a3cf754c2eaca37a0d44a5901741f1855414 (diff) | |
download | qmk_firmware-2cade3a48300e0709f8aec68602faf90947b6738.tar.gz qmk_firmware-2cade3a48300e0709f8aec68602faf90947b6738.zip |
Align some quantum sub-directories (#14134)
* Misc folder tidy
* Review comments
* Remove redundant entry
Diffstat (limited to 'data/templates/base/keymaps')
-rw-r--r-- | data/templates/base/keymaps/default/keymap.c | 62 | ||||
-rw-r--r-- | data/templates/base/keymaps/default/readme.md | 1 |
2 files changed, 63 insertions, 0 deletions
diff --git a/data/templates/base/keymaps/default/keymap.c b/data/templates/base/keymaps/default/keymap.c new file mode 100644 index 000000000..d8020ab3e --- /dev/null +++ b/data/templates/base/keymaps/default/keymap.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* Copyright %YEAR% %YOUR_NAME% | ||
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 QMK_KEYBOARD_H | ||
17 | |||
18 | // Defines names for use in layer keycodes and the keymap | ||
19 | enum layer_names { | ||
20 | _BASE, | ||
21 | _FN | ||
22 | }; | ||
23 | |||
24 | // Defines the keycodes used by our macros in process_record_user | ||
25 | enum custom_keycodes { | ||
26 | QMKBEST = SAFE_RANGE, | ||
27 | QMKURL | ||
28 | }; | ||
29 | |||
30 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
31 | /* Base */ | ||
32 | [_BASE] = LAYOUT( | ||
33 | KC_A, KC_1, MO(_FN), | ||
34 | KC_TAB, KC_SPC | ||
35 | ), | ||
36 | [_FN] = LAYOUT( | ||
37 | QMKBEST, QMKURL, _______, | ||
38 | RESET, XXXXXXX | ||
39 | ) | ||
40 | }; | ||
41 | |||
42 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
43 | switch (keycode) { | ||
44 | case QMKBEST: | ||
45 | if (record->event.pressed) { | ||
46 | // when keycode QMKBEST is pressed | ||
47 | SEND_STRING("QMK is the best thing ever!"); | ||
48 | } else { | ||
49 | // when keycode QMKBEST is released | ||
50 | } | ||
51 | break; | ||
52 | case QMKURL: | ||
53 | if (record->event.pressed) { | ||
54 | // when keycode QMKURL is pressed | ||
55 | SEND_STRING("https://qmk.fm/\n"); | ||
56 | } else { | ||
57 | // when keycode QMKURL is released | ||
58 | } | ||
59 | break; | ||
60 | } | ||
61 | return true; | ||
62 | } | ||
diff --git a/data/templates/base/keymaps/default/readme.md b/data/templates/base/keymaps/default/readme.md new file mode 100644 index 000000000..e052ed80f --- /dev/null +++ b/data/templates/base/keymaps/default/readme.md | |||
@@ -0,0 +1 @@ | |||
# The default keymap for %KEYBOARD% | |||