aboutsummaryrefslogtreecommitdiff
path: root/keyboards/christmas_tree/keymaps/default/keymap.c
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-04-10 12:13:40 +0100
committerAkshay <[email protected]>2022-04-10 12:13:40 +0100
commitdc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch)
tree4ccb8fa5886b66fa9d480edef74236c27f035e16 /keyboards/christmas_tree/keymaps/default/keymap.c
Diffstat (limited to 'keyboards/christmas_tree/keymaps/default/keymap.c')
-rw-r--r--keyboards/christmas_tree/keymaps/default/keymap.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/keyboards/christmas_tree/keymaps/default/keymap.c b/keyboards/christmas_tree/keymaps/default/keymap.c
new file mode 100644
index 000000000..6931b91a6
--- /dev/null
+++ b/keyboards/christmas_tree/keymaps/default/keymap.c
@@ -0,0 +1,82 @@
1/* Copyright 2015-2017 Jack Humbert
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
20enum layers {
21 _BASE,
22 _FUNC
23};
24
25enum custom_keycodes {
26 FUNC = SAFE_RANGE,
27 BACKLIT
28};
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31
32 /* Base
33 * ,------.
34 * | 1 |
35 * ,------+------.
36 * | 2 | 3 |
37 * ,------+------+------.
38 * | 4 | FUNC | 6 |
39 * `--------------------'
40 */
41 [_BASE] = LAYOUT(
42 KC_1,
43 KC_2, KC_3,
44 KC_4, MO(_FUNC), KC_6
45 ),
46
47 /* Func
48 * ,------.
49 * |BCKLIT|
50 * ,------+------.
51 * | 8 | 9 |
52 * ,------+------+------.
53 * | 0 | FUNC | RESET|
54 * `--------------------'
55 */
56 [_FUNC] = LAYOUT(
57 BACKLIT,
58 KC_8, KC_9,
59 KC_0, _______, RESET
60 )
61
62
63};
64
65bool process_record_user(uint16_t keycode, keyrecord_t *record) {
66 switch (keycode) {
67 case BACKLIT:
68 if (record->event.pressed) {
69 register_code(KC_RSFT);
70 #ifdef BACKLIGHT_ENABLE
71 register_code(KC_LSFT);
72 backlight_step();
73 #endif
74 } else {
75 unregister_code(KC_RSFT);
76 unregister_code(KC_LSFT);
77 }
78 return false;
79 break;
80 }
81 return true;
82}