aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/yushakobo/quick7/keymaps/tester/config.h27
-rw-r--r--keyboards/yushakobo/quick7/keymaps/tester/keymap.c157
-rw-r--r--keyboards/yushakobo/quick7/keymaps/tester/readme.md12
3 files changed, 196 insertions, 0 deletions
diff --git a/keyboards/yushakobo/quick7/keymaps/tester/config.h b/keyboards/yushakobo/quick7/keymaps/tester/config.h
new file mode 100644
index 000000000..b9a075bfe
--- /dev/null
+++ b/keyboards/yushakobo/quick7/keymaps/tester/config.h
@@ -0,0 +1,27 @@
1/*
2Copyright 2020 yushakobo
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#undef RGBLIGHT_LIMIT_VAL
19#define RGBLIGHT_LIMIT_VAL 150 /* The maximum brightness level */
20#define RGBLIGHT_LAYERS
21#define RGBLIGHT_MAX_LAYERS 4
22#define RGBLIGHT_LED_MAP {\
23 0, 1, 2,\
24 5, 4, 3,\
25 6, 7, 8,\
26 9, 10, 11, 12\
27}
diff --git a/keyboards/yushakobo/quick7/keymaps/tester/keymap.c b/keyboards/yushakobo/quick7/keymaps/tester/keymap.c
new file mode 100644
index 000000000..57e4a28f3
--- /dev/null
+++ b/keyboards/yushakobo/quick7/keymaps/tester/keymap.c
@@ -0,0 +1,157 @@
1/* Copyright 2020 yushakobo
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#define FAVORITE_COLOR HSV_CYAN
19
20// Defines names for use in layer keycodes and the keymap
21enum layer_names {
22 _BASE
23};
24
25// Defines the keycodes used by our macros in process_record_user
26enum custom_keycodes {
27 YUSHAURL = SAFE_RANGE,
28 KEY_00,
29 KEY_01,
30 KEY_02,
31 KEY_10,
32 KEY_11,
33 KEY_12,
34 KEY_20,
35 KEY_21,
36 KEY_22
37};
38
39const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
40 /* Base */
41 [_BASE] = LAYOUT(
42 KEY_00, KEY_01, KEY_02,
43 KEY_10, KEY_11, KEY_12,
44 KEY_20, KEY_21, KEY_22
45 )
46};
47
48bool process_record_user(uint16_t keycode, keyrecord_t *record) {
49 switch (keycode) {
50 case KEY_00:
51 if (record->event.pressed) {
52 rgblight_sethsv_at(FAVORITE_COLOR, 0);
53 } else {
54 rgblight_sethsv_at(HSV_WHITE, 0);
55 }
56 break;
57 case KEY_01:
58 if (record->event.pressed) {
59 rgblight_sethsv_at(FAVORITE_COLOR, 1);
60 } else {
61 rgblight_sethsv_at(HSV_WHITE, 1);
62 }
63 break;
64 case KEY_02:
65 if (record->event.pressed) {
66 rgblight_sethsv_at(FAVORITE_COLOR, 2);
67 } else {
68 rgblight_sethsv_at(HSV_WHITE, 2);
69 }
70 break;
71 case KEY_10:
72 if (record->event.pressed) {
73 rgblight_sethsv_at(FAVORITE_COLOR, 3);
74 } else {
75 rgblight_sethsv_at(HSV_WHITE, 3);
76 }
77 break;
78 case KEY_11:
79 if (record->event.pressed) {
80 rgblight_sethsv_at(FAVORITE_COLOR, 4);
81 } else {
82 rgblight_sethsv_at(HSV_WHITE, 4);
83 }
84 break;
85 case KEY_12:
86 if (record->event.pressed) {
87 rgblight_sethsv_at(FAVORITE_COLOR, 5);
88 } else {
89 rgblight_sethsv_at(HSV_WHITE, 5);
90 }
91 break;
92 case KEY_20:
93 if (record->event.pressed) {
94 rgblight_sethsv_at(FAVORITE_COLOR, 6);
95 } else {
96 rgblight_sethsv_at(HSV_WHITE, 6);
97 }
98 break;
99 case KEY_21:
100 if (record->event.pressed) {
101 rgblight_sethsv_at(FAVORITE_COLOR, 7);
102 } else {
103 rgblight_sethsv_at(HSV_WHITE, 7);
104 }
105 break;
106 case KEY_22:
107 if (record->event.pressed) {
108 rgblight_sethsv_at(FAVORITE_COLOR, 8);
109 } else {
110 rgblight_sethsv_at(HSV_WHITE, 8);
111 }
112 break;
113 }
114 return true;
115}
116
117void encoder_update_user(uint8_t index, bool clockwise) {
118 if (index == 0) { // Left encoder
119 if (clockwise) {
120 tap_code(KC_VOLU);
121 } else {
122 tap_code(KC_VOLD);
123 }
124 }
125 else if (index == 1) { // Right encoder
126 if (clockwise) {
127 rgblight_decrease_hue_noeeprom();
128 } else {
129 rgblight_increase_hue_noeeprom();
130 }
131 }
132}
133
134const rgblight_segment_t PROGMEM quick7_capslock[] = RGBLIGHT_LAYER_SEGMENTS(
135 {9,1,FAVORITE_COLOR},
136 {12,1,FAVORITE_COLOR}
137);
138const rgblight_segment_t PROGMEM quick7_numlock[] = RGBLIGHT_LAYER_SEGMENTS(
139 {10,1,FAVORITE_COLOR},
140 {11,1,FAVORITE_COLOR}
141);
142
143const rgblight_segment_t* const PROGMEM quick7_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
144 quick7_capslock,
145 quick7_numlock
146);
147
148void keyboard_post_init_user(void){
149 rgblight_layers = quick7_rgb_layers;
150 rgblight_sethsv(HSV_WHITE);
151}
152
153bool led_update_user(led_t led_state){
154 rgblight_set_layer_state(0, led_state.caps_lock);
155 rgblight_set_layer_state(1, led_state.num_lock);
156 return true;
157} \ No newline at end of file
diff --git a/keyboards/yushakobo/quick7/keymaps/tester/readme.md b/keyboards/yushakobo/quick7/keymaps/tester/readme.md
new file mode 100644
index 000000000..41ba72ffc
--- /dev/null
+++ b/keyboards/yushakobo/quick7/keymaps/tester/readme.md
@@ -0,0 +1,12 @@
1# The default keymap for quick7
2
3### Base Layer
4
5|Left/Right|Clockwise|Counter Clockwise|
6|---|---|---|
7|Left|Vol+|Vol-|
8|Right|RGB HUE-|RGB HUE+|
9
10No input at all. You can just test how deep the key's actuation point is, and when does the key releases.
11
124 underglow LEDs indicates the status of CapsLock and NumLock.