1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
#include QMK_KEYBOARD_H
//#include "v1.h"
//Following line allows macro to read current RGB settings
rgblight_config_t RGB_current_config;
#define KC_KANJI KC_GRV
enum Layer
{
_QWERTY,
_DIA,
_YOU,
_CHIKA,
_ZURA,
_RUBY,
_YOHANE,
_RIKO,
_MARI,
_KANAN,
_RUBY_SUB1,
_RUBY_SUB2,
_RUBY_SUB3,
_SCHOOL_IDOL_FESTIVAL
};
#define SEND_DIA 100
#define SEND_YOU 101
#define SEND_CHIKA 102
#define SEND_ZURA 103
#define SEND_RUBY 104
#define SEND_YOHANE 105
#define SEND_RIKO 106
#define SEND_MARI 107
#define SEND_KANAN 108
enum custom_keycodes {
QWERTY = SAFE_RANGE,
DIA,
YOU,
CHIKA,
ZURA,
RUBY,
RUBY_SUB1,
RUBY_SUB2,
RUBY_SUB3,
YOHANE,
RIKO,
MARI,
KANAN,
TO_SCHOOL_IDOL_FESTIVAL,
RETURN_SCHOOL_IDOL_FESTIVAL
};
int long_tap_timer;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
DIA, YOU, CHIKA, ZURA, RUBY, YOHANE, RIKO, MARI, KANAN
),
[_DIA] = LAYOUT(
DIA, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_LSFT
),
[_YOU] = LAYOUT(
KC_H, YOU, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_LSFT
),
[_CHIKA] = LAYOUT(
KC_O, KC_P, CHIKA, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_LSFT
),
[_ZURA] = LAYOUT(
KC_V, KC_W, KC_X, ZURA, KC_Y, KC_Z, KC_M, KC_N, KC_LSFT
),
//推しをたくさん押せるようにルビーちゃんには複数のレイヤー設定
[_RUBY] = LAYOUT(
KC_CIRC, KC_LPRN, KC_QUOT, RUBY_SUB1, RUBY, RUBY_SUB2, KC_LCBR, KC_EXLM, KC_LSFT
),
[_RUBY_SUB1] = LAYOUT(
KC_RCBR, KC_AT, KC_PIPE, RUBY_SUB1, RUBY, RUBY_SUB2, KC_HASH, KC_EQL, KC_LSFT
),
[_RUBY_SUB2] = LAYOUT(
KC_TILD, KC_DLR, KC_LBRC, RUBY_SUB1, RUBY, RUBY_SUB2, KC_PERC, KC_RBRC, KC_LSFT
),
[_RUBY_SUB3] = LAYOUT(
TO_SCHOOL_IDOL_FESTIVAL, KC_DLR, KC_LBRC, RUBY_SUB1, RUBY, RUBY_SUB2, KC_PERC, KC_RBRC, RETURN_SCHOOL_IDOL_FESTIVAL
),
[_YOHANE] = LAYOUT(
KC_0, KC_1, KC_2, KC_3, KC_4, YOHANE, KC_5, KC_6, KC_LSFT
),
[_RIKO] = LAYOUT(
KC_7, KC_8, KC_9, KC_PLUS, KC_MINS, KC_ASTR, RIKO, KC_SLSH, KC_LSFT
),
[_MARI] = LAYOUT(
KC_TAB, KC_DEL, KC_COMM, KC_SPC, KC_ENT, KC_BSPC, KC_DOT, MARI, KC_LSFT
),
[_KANAN] = LAYOUT(
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, KC_BSPC, KC_AMPR, KC_KANJI, KANAN
),
[_SCHOOL_IDOL_FESTIVAL] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9
),
};
void check_tap_and_send_key(int MEMBER) {
if (long_tap_timer < 500) {
switch (MEMBER) {
case SEND_DIA:
SEND_STRING("KUROSAWA DIA");
break;
case SEND_YOU:
SEND_STRING("WATANABE YOU");
break;
case SEND_CHIKA:
SEND_STRING("TAKAMI CHIKA");
break;
case SEND_ZURA:
SEND_STRING("KUNIKIDA HANAMARU");
break;
case SEND_RUBY:
SEND_STRING("KUROSAWA RUBY");
break;
case SEND_YOHANE:
SEND_STRING("TSUSHIMA YOSHIKO");
break;
case SEND_RIKO:
SEND_STRING("SAKURAUCHI RIKO");
break;
case SEND_MARI:
SEND_STRING("OHARA MARI");
break;
case SEND_KANAN:
SEND_STRING("MATSUURA KANAN");
break;
}
}
long_tap_timer = 0;
}
int aqours_color_h[] = { 26, 340, 150, 0, 199, 220, 53, 265, 322};
int aqours_color_s[] = {255, 165, 255, 255, 255, 350, 255, 255, 255};
int aqours_color_v[] = {255, 255, 255, 255, 255, 255, 200, 255, 255};
void LED_default_set(void) {
sethsv(aqours_color_h[2], aqours_color_s[2], aqours_color_v[2], (LED_TYPE *)&led[0]);
sethsv(aqours_color_h[7], aqours_color_s[7], aqours_color_v[7], (LED_TYPE *)&led[1]);
sethsv(aqours_color_h[1], aqours_color_s[1], aqours_color_v[1], (LED_TYPE *)&led[2]);
sethsv(aqours_color_h[5], aqours_color_s[5], aqours_color_v[5], (LED_TYPE *)&led[3]);
sethsv(aqours_color_h[8], aqours_color_s[8], aqours_color_v[8], (LED_TYPE *)&led[4]);
sethsv(aqours_color_h[6], aqours_color_s[6], aqours_color_v[6], (LED_TYPE *)&led[5]);
sethsv(aqours_color_h[0], aqours_color_s[0], aqours_color_v[0], (LED_TYPE *)&led[6]);
sethsv(aqours_color_h[4], aqours_color_s[4], aqours_color_v[4], (LED_TYPE *)&led[7]);
sethsv(aqours_color_h[3], aqours_color_s[3], aqours_color_v[3], (LED_TYPE *)&led[8]);
rgblight_set();
}
void LED_layer_set(int aqours_index) {
for (int c = 0; c < 9; c++) {
sethsv(aqours_color_h[aqours_index], aqours_color_s[aqours_index], aqours_color_v[aqours_index], (LED_TYPE *)&led[c]);
}
rgblight_set();
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case DIA:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_DIA);
LED_layer_set(3);
} else {
check_tap_and_send_key(SEND_DIA);
layer_off(_DIA);
LED_default_set();
}
break;
case YOU:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_YOU);
LED_layer_set(4);
} else {
check_tap_and_send_key(SEND_YOU);
layer_off(_YOU);
LED_default_set();
}
break;
case CHIKA:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_CHIKA);
LED_layer_set(0);
} else {
check_tap_and_send_key(SEND_CHIKA);
layer_off(_CHIKA);
LED_default_set();
}
break;
case ZURA:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_ZURA);
LED_layer_set(6);
} else {
check_tap_and_send_key(SEND_ZURA);
layer_off(_ZURA);
LED_default_set();
}
break;
case RUBY:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_RUBY);
LED_layer_set(8);
} else {
check_tap_and_send_key(SEND_RUBY);
layer_off(_RUBY);
LED_default_set();
}
break;
case RUBY_SUB1:
if (record->event.pressed) {
layer_on(_RUBY_SUB1);
if (IS_LAYER_ON(_RUBY_SUB1) && IS_LAYER_ON(_RUBY_SUB2)) {
layer_on(_RUBY_SUB3);
} else {
layer_off(_RUBY_SUB3);
}
} else {
layer_off(_RUBY_SUB1);
}
break;
case RUBY_SUB2:
if (record->event.pressed) {
layer_on(_RUBY_SUB2);
if (IS_LAYER_ON(_RUBY_SUB1) && IS_LAYER_ON(_RUBY_SUB2)) {
layer_on(_RUBY_SUB3);
} else {
layer_off(_RUBY_SUB3);
}
} else {
layer_off(_RUBY_SUB2);
}
break;
case YOHANE:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_YOHANE);
LED_layer_set(5);
} else {
check_tap_and_send_key(SEND_YOHANE);
layer_off(_YOHANE);
LED_default_set();
}
break;
case RIKO:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_RIKO);
LED_layer_set(1);
} else {
check_tap_and_send_key(SEND_RIKO);
layer_off(_RIKO);
LED_default_set();
}
break;
case MARI:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_MARI);
LED_layer_set(7);
} else {
check_tap_and_send_key(SEND_MARI);
layer_off(_MARI);
LED_default_set();
}
break;
case KANAN:
if (record->event.pressed) {
long_tap_timer = 1;
layer_on(_KANAN);
LED_layer_set(2);
} else {
check_tap_and_send_key(SEND_KANAN);
layer_off(_KANAN);
LED_default_set();
}
break;
case TO_SCHOOL_IDOL_FESTIVAL:
if (record->event.pressed) {
LED_default_set();
layer_on(_SCHOOL_IDOL_FESTIVAL);
}
break;
case RETURN_SCHOOL_IDOL_FESTIVAL:
if (record->event.pressed) {
layer_off(_SCHOOL_IDOL_FESTIVAL);
}
break;
}
return true;
}
void matrix_scan_user(void) {
if (long_tap_timer > 0) {
long_tap_timer++;
}
}
|