aboutsummaryrefslogtreecommitdiff
path: root/quantum/template/base
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/template/base')
-rw-r--r--quantum/template/base/info.json18
-rw-r--r--quantum/template/base/keyboard.c50
-rw-r--r--quantum/template/base/keyboard.h7
-rw-r--r--quantum/template/base/keymaps/default/keymap.c19
4 files changed, 88 insertions, 6 deletions
diff --git a/quantum/template/base/info.json b/quantum/template/base/info.json
index e69de29bb..b8e8f1f2d 100644
--- a/quantum/template/base/info.json
+++ b/quantum/template/base/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "%KEYBOARD%",
3 "url": "",
4 "maintainer": "%YOUR_NAME%",
5 "width": 3,
6 "height": 2,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"label":"k00", "x":0, "y":0},
11 {"label":"k01", "x":1, "y":0},
12 {"label":"k02", "x":2, "y":0},
13 {"label":"k10", "x":0, "y":1, "w":1.5},
14 {"label":"k12", "x":1.5, "y":1, "w":1.5}
15 ]
16 }
17 }
18}
diff --git a/quantum/template/base/keyboard.c b/quantum/template/base/keyboard.c
new file mode 100644
index 000000000..55e4fffd3
--- /dev/null
+++ b/quantum/template/base/keyboard.c
@@ -0,0 +1,50 @@
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
17#include "%KEYBOARD%.h"
18
19// Optional override functions below.
20// You can leave any or all of these undefined.
21// These are only required if you want to perform custom actions.
22
23/*
24void matrix_init_kb(void) {
25 // put your keyboard start-up code here
26 // runs once when the firmware starts up
27
28 matrix_init_user();
29}
30
31void matrix_scan_kb(void) {
32 // put your looping keyboard code here
33 // runs every cycle (a lot)
34
35 matrix_scan_user();
36}
37
38bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
39 // put your per-action keyboard code here
40 // runs for every action, just before processing by the firmware
41
42 return process_record_user(keycode, record);
43}
44
45void led_set_kb(uint8_t usb_led) {
46 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
47
48 led_set_user(usb_led);
49}
50*/
diff --git a/quantum/template/base/keyboard.h b/quantum/template/base/keyboard.h
index 2e531b1fd..8a21d9257 100644
--- a/quantum/template/base/keyboard.h
+++ b/quantum/template/base/keyboard.h
@@ -13,11 +13,12 @@
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
16#pragma once 17#pragma once
17 18
18#include "quantum.h" 19#include "quantum.h"
19 20
20/* This a shortcut to help you visually see your layout. 21/* This is a shortcut to help you visually see your layout.
21 * 22 *
22 * The first section contains all of the arguments representing the physical 23 * The first section contains all of the arguments representing the physical
23 * layout of the board and position of the keys. 24 * layout of the board and position of the keys.
@@ -27,9 +28,9 @@
27 */ 28 */
28#define LAYOUT( \ 29#define LAYOUT( \
29 k00, k01, k02, \ 30 k00, k01, k02, \
30 k10, k11 \ 31 k10, k12 \
31) \ 32) \
32{ \ 33{ \
33 { k00, k01, k02 }, \ 34 { k00, k01, k02 }, \
34 { k10, KC_NO, k11 }, \ 35 { k10, KC_NO, k12 } \
35} 36}
diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c
index 3508055b7..4d5bac7b2 100644
--- a/quantum/template/base/keymaps/default/keymap.c
+++ b/quantum/template/base/keymaps/default/keymap.c
@@ -15,6 +15,12 @@
15 */ 15 */
16#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
17 17
18// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
18// Defines the keycodes used by our macros in process_record_user 24// Defines the keycodes used by our macros in process_record_user
19enum custom_keycodes { 25enum custom_keycodes {
20 QMKBEST = SAFE_RANGE, 26 QMKBEST = SAFE_RANGE,
@@ -22,10 +28,15 @@ enum custom_keycodes {
22}; 28};
23 29
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 [0] = LAYOUT( /* Base */ 31 /* Base */
26 KC_A, KC_1, KC_H, 32 [_BASE] = LAYOUT(
27 KC_TAB, KC_SPC 33 KC_A, KC_1, MO(_FN),
34 KC_TAB, KC_SPC
28 ), 35 ),
36 [_FN] = LAYOUT(
37 QMKBEST, QMKURL, _______,
38 RESET, XXXXXXX
39 )
29}; 40};
30 41
31bool process_record_user(uint16_t keycode, keyrecord_t *record) { 42bool process_record_user(uint16_t keycode, keyrecord_t *record) {
@@ -50,6 +61,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
50 return true; 61 return true;
51} 62}
52 63
64/*
53void matrix_init_user(void) { 65void matrix_init_user(void) {
54 66
55} 67}
@@ -61,3 +73,4 @@ void matrix_scan_user(void) {
61void led_set_user(uint8_t usb_led) { 73void led_set_user(uint8_t usb_led) {
62 74
63} 75}
76*/