aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpttbx <57902726+pttbx@users.noreply.github.com>2021-10-27 23:09:19 +0800
committerGitHub <noreply@github.com>2021-10-27 08:09:19 -0700
commite4ae4c8b1ceef6617aa3928901c78eaa1e8fd5b5 (patch)
tree54c916b233da6c4916947480dd3744ab6ab18da2
parent59738955293c85abcc5d9bd6998e3ed90ced4733 (diff)
downloadqmk_firmware-e4ae4c8b1ceef6617aa3928901c78eaa1e8fd5b5.tar.gz
qmk_firmware-e4ae4c8b1ceef6617aa3928901c78eaa1e8fd5b5.zip
[Keymap] Add personal lily58 keymap (#14834)
Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: polplop <paultan@handshakes.com.sg> Co-authored-by: paultan <47445257+polplop@users.noreply.github.com>
-rw-r--r--keyboards/lily58/keymaps/pttbx/config.h46
-rw-r--r--keyboards/lily58/keymaps/pttbx/keymap.c164
-rw-r--r--keyboards/lily58/keymaps/pttbx/rules.mk5
3 files changed, 215 insertions, 0 deletions
diff --git a/keyboards/lily58/keymaps/pttbx/config.h b/keyboards/lily58/keymaps/pttbx/config.h
new file mode 100644
index 000000000..d843f5b1c
--- /dev/null
+++ b/keyboards/lily58/keymaps/pttbx/config.h
@@ -0,0 +1,46 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23/* Select hand configuration */
24
25#define MASTER_LEFT
26// #define MASTER_RIGHT
27// #define EE_HANDS
28
29#define TAPPING_FORCE_HOLD
30#define TAPPING_TERM 100
31
32#undef RGBLED_NUM
33#define RGBLIGHT_ANIMATIONS
34#define RGBLED_NUM 27
35#define RGBLIGHT_LIMIT_VAL 120
36#define RGBLIGHT_HUE_STEP 10
37#define RGBLIGHT_SAT_STEP 17
38#define RGBLIGHT_VAL_STEP 17
39
40// Underglow
41/*
42#undef RGBLED_NUM
43#define RGBLED_NUM 14 // Number of LEDs
44#define RGBLIGHT_ANIMATIONS
45#define RGBLIGHT_SLEEP
46*/
diff --git a/keyboards/lily58/keymaps/pttbx/keymap.c b/keyboards/lily58/keymaps/pttbx/keymap.c
new file mode 100644
index 000000000..944794141
--- /dev/null
+++ b/keyboards/lily58/keymaps/pttbx/keymap.c
@@ -0,0 +1,164 @@
1/* Copyright 2021 Paul Tan
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
19enum layer_number {
20 _QWERTY = 0,
21 _LOWER,
22 _RAISE,
23 _ADJUST,
24};
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27
28/* QWERTY
29 * ,-----------------------------------------. ,-----------------------------------------.
30 * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
31 * |------+------+------+------+------+------| |------+------+------+------+------+------|
32 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | - |
33 * |------+------+------+------+------+------| |------+------+------+------+------+------|
34 * |LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' |
35 * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------|
36 * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift|
37 * `-----------------------------------------/ / \ \-----------------------------------------'
38 * | LOWER| LGUI |LAlt | /Space / \Enter \ |BackSP| RGUI |RAISE |
39 * | | | |/ / \ \ | | | |
40 * `----------------------------' '------''--------------------'
41 */
42
43 [_QWERTY] = LAYOUT(
44 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV,
45 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
46 KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
47 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
48 MO(_LOWER), KC_LGUI, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, MO(_RAISE)
49),
50/* LOWER
51 * ,-----------------------------------------. ,-----------------------------------------.
52 * | | | | | | | | | | | | | |
53 * |------+------+------+------+------+------| |------+------+------+------+------+------|
54 * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
55 * |------+------+------+------+------+------| |------+------+------+------+------+------|
56 * | ` | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | - |
57 * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------|
58 * | | | | | | |-------| |-------| | _ | + | { | } | | |
59 * `-----------------------------------------/ / \ \-----------------------------------------'
60 * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI |
61 * | | | |/ / \ \ | | | |
62 * `----------------------------' '------''--------------------'
63 */
64[_LOWER] = LAYOUT(
65 _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______,
66 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
67 KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD,
68 _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
69 _______, _______, _______, _______, _______, _______, _______, _______
70),
71/* RAISE
72 * ,-----------------------------------------. ,-----------------------------------------.
73 * | | | | | | | | | | | | | |
74 * |------+------+------+------+------+------| |------+------+------+------+------+------|
75 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
76 * |------+------+------+------+------+------| |------+------+------+------+------+------|
77 * | F1 | F2 | F3 | F4 | F5 | F6 |-------. ,-------| | Left | Down | Up |Right | |
78 * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------|
79 * | F7 | F8 | F9 | F10 | F11 | F12 |-------| |-------| + | - | = | [ | ] | \ |
80 * `-----------------------------------------/ / \ \-----------------------------------------'
81 * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI |
82 * | | | |/ / \ \ | | | |
83 * `----------------------------' '------''--------------------'
84 */
85
86[_RAISE] = LAYOUT(
87 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
88 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
89 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX,
90 KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
91 _______, _______, _______, _______, _______, _______, _______, _______
92),
93/* ADJUST
94 * ,-----------------------------------------. ,-----------------------------------------.
95 * | | | | | | | | | | | | | |
96 * |------+------+------+------+------+------| |------+------+------+------+------+------|
97 * | | | | | | | | | | | | | |
98 * |------+------+------+------+------+------| |------+------+------+------+------+------|
99 * | | | | | | |-------. ,-------| | |RGB ON| HUE+ | SAT+ | VAL+ |
100 * |------+------+------+------+------+------| | | |------+------+------+------+------+------|
101 * | | | | | | |-------| |-------| | | MODE | HUE- | SAT- | VAL- |
102 * `-----------------------------------------/ / \ \-----------------------------------------'
103 * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI |
104 * | | | |/ / \ \ | | | |
105 * `----------------------------' '------''--------------------'
106 */
107 [_ADJUST] = LAYOUT(
108 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
109 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
110 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
111 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
112 _______, _______, _______, _______, _______, _______, _______, _______
113 )
114};
115
116layer_state_t layer_state_set_user(layer_state_t state) {
117 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
118}
119
120//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
121#ifdef OLED_ENABLE
122
123oled_rotation_t oled_init_user(oled_rotation_t rotation) {
124 if (!is_keyboard_master())
125 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
126 return rotation;
127}
128
129// When you add source files to SRC in rules.mk, you can use functions.
130const char *read_layer_state(void);
131const char *read_logo(void);
132void set_keylog(uint16_t keycode, keyrecord_t *record);
133const char *read_keylog(void);
134const char *read_keylogs(void);
135
136// const char *read_mode_icon(bool swap);
137// const char *read_host_led_state(void);
138// void set_timelog(void);
139// const char *read_timelog(void);
140
141void oled_task_user(void) {
142 if (is_keyboard_master()) {
143 // If you want to change the display of OLED, you need to change here
144 oled_write_ln(read_layer_state(), false);
145 oled_write_ln(read_keylog(), false);
146 oled_write_ln(read_keylogs(), false);
147 //oled_write_ln(read_mode_icon(keymap_config.swap_lalt_lgui), false);
148 //oled_write_ln(read_host_led_state(), false);
149 //oled_write_ln(read_timelog(), false);
150 } else {
151 oled_write(read_logo(), false);
152 }
153}
154#endif // OLED_ENABLE
155
156bool process_record_user(uint16_t keycode, keyrecord_t *record) {
157 if (record->event.pressed) {
158#ifdef OLED_ENABLE
159 set_keylog(keycode, record);
160#endif
161 // set_timelog();
162 }
163 return true;
164}
diff --git a/keyboards/lily58/keymaps/pttbx/rules.mk b/keyboards/lily58/keymaps/pttbx/rules.mk
new file mode 100644
index 000000000..e2c8a6f74
--- /dev/null
+++ b/keyboards/lily58/keymaps/pttbx/rules.mk
@@ -0,0 +1,5 @@
1# If you want to change the display of OLED, you need to change here
2SRC += ./lib/rgb_state_reader.c \
3 ./lib/layer_state_reader.c \
4 ./lib/logo_reader.c \
5 ./lib/keylogger.c