diff options
-rw-r--r-- | keyboards/gmmk/pro/ansi/keymaps/byungyoonc/config.h | 72 | ||||
-rw-r--r-- | keyboards/gmmk/pro/ansi/keymaps/byungyoonc/keymap.c | 129 | ||||
-rw-r--r-- | keyboards/gmmk/pro/ansi/keymaps/byungyoonc/readme.md | 41 | ||||
-rw-r--r-- | keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rgb_matrix_user.inc | 1 | ||||
-rw-r--r-- | keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rules.mk | 2 | ||||
-rw-r--r-- | users/byungyoonc/byungyoonc.c | 48 | ||||
-rw-r--r-- | users/byungyoonc/byungyoonc.h | 27 | ||||
-rw-r--r-- | users/byungyoonc/readme.md | 14 | ||||
-rw-r--r-- | users/byungyoonc/rules.mk | 1 | ||||
-rw-r--r-- | users/byungyoonc/saturated_solid_multisplash.h | 50 |
10 files changed, 385 insertions, 0 deletions
diff --git a/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/config.h b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/config.h new file mode 100644 index 000000000..16ac4f240 --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/config.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com> | ||
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 | #pragma once | ||
18 | |||
19 | #define RGB_MATRIX_KEYPRESSES | ||
20 | |||
21 | // RGB Matrix Animation modes. Explicitly enabled | ||
22 | // For full list of effects, see: | ||
23 | // https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects | ||
24 | // #define ENABLE_RGB_MATRIX_ALPHAS_MODS | ||
25 | // #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
26 | // #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
27 | // #define ENABLE_RGB_MATRIX_BREATHING | ||
28 | #undef ENABLE_RGB_MATRIX_BAND_SAT | ||
29 | #undef ENABLE_RGB_MATRIX_BAND_VAL | ||
30 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
31 | #undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
32 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
33 | #undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
34 | // #define ENABLE_RGB_MATRIX_CYCLE_ALL | ||
35 | // #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
36 | // #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
37 | // #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
38 | #undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
39 | #undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
40 | #undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL | ||
41 | #undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL | ||
42 | #undef ENABLE_RGB_MATRIX_DUAL_BEACON | ||
43 | #undef ENABLE_RGB_MATRIX_RAINBOW_BEACON | ||
44 | #undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
45 | // #define ENABLE_RGB_MATRIX_RAINDROPS | ||
46 | // #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
47 | #undef ENABLE_RGB_MATRIX_HUE_BREATHING | ||
48 | #undef ENABLE_RGB_MATRIX_HUE_PENDULUM | ||
49 | #undef ENABLE_RGB_MATRIX_HUE_WAVE | ||
50 | // #define ENABLE_RGB_MATRIX_PIXEL_RAIN | ||
51 | #undef ENABLE_RGB_MATRIX_PIXEL_FLOW | ||
52 | #undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL | ||
53 | // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined | ||
54 | // #define ENABLE_RGB_MATRIX_TYPING_HEATMAP | ||
55 | // #define ENABLE_RGB_MATRIX_DIGITAL_RAIN | ||
56 | // enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined | ||
57 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
58 | // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE | ||
59 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
60 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
61 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
62 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
63 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
64 | #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
65 | #undef ENABLE_RGB_MATRIX_SPLASH | ||
66 | // #define ENABLE_RGB_MATRIX_MULTISPLASH | ||
67 | #undef ENABLE_RGB_MATRIX_SOLID_SPLASH | ||
68 | // #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
69 | |||
70 | #undef DEBOUNCE | ||
71 | /* High debounce time is required to avoid key chattering because of the debouncing algorithm sym_eager_pk */ | ||
72 | #define DEBOUNCE 40 | ||
diff --git a/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/keymap.c b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/keymap.c new file mode 100644 index 000000000..1ad8417de --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/keymap.c | |||
@@ -0,0 +1,129 @@ | |||
1 | /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com> | ||
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 | #include "byungyoonc.h" | ||
19 | |||
20 | // clang-format off | ||
21 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
22 | |||
23 | // ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Rotary(Mic Mute) | ||
24 | // ~ 1 2 3 4 5 6 7 8 9 0 - (=) BackSpc TaskMgr | ||
25 | // Tab Q W E R T Y U I O P [ ] \ Del | ||
26 | // Caps A S D F G H J K L ; " Enter Home | ||
27 | // Sh_L Z X C V B N M , . ? Sh_R Up End | ||
28 | // Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right | ||
29 | |||
30 | [0] = LAYOUT( | ||
31 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_MMUT, | ||
32 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TASK, | ||
33 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, | ||
34 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, | ||
35 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, | ||
36 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
37 | ), | ||
38 | |||
39 | [1] = LAYOUT( | ||
40 | _______, KC_BRID, KC_BRIU, KC_CALC, KC_MSEL, RGB_VAD, RGB_VAI, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, | ||
41 | _______, KC_SEC1, KC_SEC2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DEBUG, _______, | ||
42 | _______, _______, _______, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, | ||
43 | _______, _______, _______, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
44 | _______, _______, RGB_HUI, RGB_HUD, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, RGB_MOD, _______, | ||
45 | _______, GUI_TOG, _______, _______, _______, _______, _______, RGB_SPD, RGB_RMOD, RGB_SPI | ||
46 | ), | ||
47 | |||
48 | |||
49 | }; | ||
50 | // clang-format on | ||
51 | |||
52 | bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) { | ||
53 | if (record->event.pressed) { | ||
54 | rgblight_increase_hue(); | ||
55 | } | ||
56 | return true; | ||
57 | } | ||
58 | |||
59 | #if defined(ENCODER_ENABLE) | ||
60 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
61 | uint8_t mod_state = get_mods(); | ||
62 | if (mod_state & MOD_MASK_CTRL) { | ||
63 | unregister_mods(MOD_MASK_CTRL); | ||
64 | if (clockwise) { | ||
65 | tap_code16(LCTL(KC_RGHT)); | ||
66 | } else { | ||
67 | tap_code16(LCTL(KC_LEFT)); | ||
68 | } | ||
69 | set_mods(mod_state); | ||
70 | } else { | ||
71 | if (clockwise) { | ||
72 | tap_code16(KC_VOLU); | ||
73 | } else { | ||
74 | tap_code16(KC_VOLD); | ||
75 | } | ||
76 | } | ||
77 | return true; | ||
78 | } | ||
79 | #endif // ENCODER_ENABLE | ||
80 | |||
81 | static void set_rgb_caps_leds(void); | ||
82 | |||
83 | static void set_rgb_caps_leds() { | ||
84 | rgb_matrix_set_color(73, 0xFF, 0x77, 0x77); // Left side LED 3 | ||
85 | rgb_matrix_set_color(74, 0xFF, 0x77, 0x77); // Right side LED 3 | ||
86 | rgb_matrix_set_color(76, 0xFF, 0x77, 0x77); // Left side LED 4 | ||
87 | rgb_matrix_set_color(77, 0xFF, 0x77, 0x77); // Right side LED 4 | ||
88 | rgb_matrix_set_color(80, 0xFF, 0x77, 0x77); // Left side LED 5 | ||
89 | rgb_matrix_set_color(81, 0xFF, 0x77, 0x77); // Right side LED 5 | ||
90 | rgb_matrix_set_color(83, 0xFF, 0x77, 0x77); // Left side LED 6 | ||
91 | rgb_matrix_set_color(84, 0xFF, 0x77, 0x77); // Right side LED 6 | ||
92 | rgb_matrix_set_color(3, 0xFF, 0x77, 0x77); // CAPS LED | ||
93 | } | ||
94 | |||
95 | static void set_rgb_nlck_notset_leds(void); | ||
96 | |||
97 | static void set_rgb_wlck_leds(void); | ||
98 | |||
99 | static void set_rgb_nlck_notset_leds() { | ||
100 | rgb_matrix_set_color(67, 0x77, 0x77, 0xFF); // Left side LED 1 | ||
101 | rgb_matrix_set_color(68, 0x77, 0x77, 0xFF); // Right side LED 1 | ||
102 | rgb_matrix_set_color(70, 0x77, 0x77, 0xFF); // Left side LED 2 | ||
103 | rgb_matrix_set_color(71, 0x77, 0x77, 0xFF); // Right side LED 2 | ||
104 | } | ||
105 | |||
106 | static void set_rgb_wlck_leds() { | ||
107 | rgb_matrix_set_color(87, 0x77, 0xFF, 0x77); // Left side LED 7 | ||
108 | rgb_matrix_set_color(88, 0x77, 0xFF, 0x77); // Right side LED 7 | ||
109 | rgb_matrix_set_color(91, 0x77, 0xFF, 0x77); // Left side LED 8 | ||
110 | rgb_matrix_set_color(92, 0x77, 0xFF, 0x77); // Right side LED 8 | ||
111 | } | ||
112 | |||
113 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | ||
114 | if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { | ||
115 | set_rgb_caps_leds(); | ||
116 | } | ||
117 | if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { | ||
118 | set_rgb_nlck_notset_leds(); | ||
119 | } | ||
120 | if (keymap_config.no_gui) { | ||
121 | set_rgb_wlck_leds(); | ||
122 | } | ||
123 | } | ||
124 | |||
125 | void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | ||
126 | for (int i = 0; i < 20; i++) { | ||
127 | wait_cpuclock(STM32_SYSCLK / 1000000L); | ||
128 | } | ||
129 | } | ||
diff --git a/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/readme.md b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/readme.md new file mode 100644 index 000000000..d340bf86e --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/readme.md | |||
@@ -0,0 +1,41 @@ | |||
1 | byungyoonc's GMMK Pro Layout | ||
2 | ============================ | ||
3 | |||
4 | ## Keymap | ||
5 | |||
6 | ### Base Layer | ||
7 |  | ||
8 | |||
9 | Made a bit of a change on the leftmost side of the keyboard to set Home and End closer to the arrow keys. Also uses a shortcut for Windows Task Manager, Windows PowerToys microphone mute. | ||
10 | |||
11 | ### Fn Layer | ||
12 |  | ||
13 | |||
14 | F-row media functions roughly matches the Keychron keyboard's layout. | ||
15 | |||
16 | Added Debug key for faster debugging iteration. | ||
17 | |||
18 | Supports Secrets input by Fn + Numbers. | ||
19 | |||
20 | The rest are pretty self-explanatory RGB controls, a GUI toggle and an NKRO toggle. | ||
21 | |||
22 | ## Rotary Encoder Rotation | ||
23 | Volume control when no mods, Ctrl+Left/Right when Ctrl is pressed while rotating the encoder. | ||
24 | |||
25 | ## RGB Indicators | ||
26 | Uses side strap RGB as the RGB indicators. | ||
27 | - Top third lights on when the Num Lock is turned off. | ||
28 | - Middle third lights on when the Caps Lock is turned on. | ||
29 | - Bottom third lights on when the GUI is disabled (via `GUI_TOG`). | ||
30 | |||
31 | ## Debounce | ||
32 | Uses the `DEBOUNCE_TYPE` of `sym_eager_pk` for the shortest response time possible, and `DEBOUNCE` time of `40` in order to eliminate any key chattering. | ||
33 | |||
34 | ## NKRO | ||
35 | N-key rollover is turned on by default. | ||
36 | |||
37 | ## RGB Matrix | ||
38 | Keypresses effects are enabled. | ||
39 | Disabled default several RGB effects. | ||
40 | Added custom RGB matrix effect `saturated_solid_multisplash`. | ||
41 | Every keypress increases the RGB hue value. | ||
diff --git a/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rgb_matrix_user.inc b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rgb_matrix_user.inc new file mode 100644 index 000000000..0d61e19f4 --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rgb_matrix_user.inc | |||
@@ -0,0 +1 @@ | |||
#include "saturated_solid_multisplash.h" | |||
diff --git a/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rules.mk b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rules.mk new file mode 100644 index 000000000..08f832c51 --- /dev/null +++ b/keyboards/gmmk/pro/ansi/keymaps/byungyoonc/rules.mk | |||
@@ -0,0 +1,2 @@ | |||
1 | DEBOUNCE_TYPE = sym_eager_pk | ||
2 | RGB_MATRIX_CUSTOM_USER = yes | ||
diff --git a/users/byungyoonc/byungyoonc.c b/users/byungyoonc/byungyoonc.c new file mode 100644 index 000000000..5059de0d9 --- /dev/null +++ b/users/byungyoonc/byungyoonc.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com> | ||
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 | #include "byungyoonc.h" | ||
19 | |||
20 | #if (__has_include("secrets.h") && !defined(NO_SECRETS)) | ||
21 | # include "secrets.h" | ||
22 | #else | ||
23 | static const char *const secrets[] = {"test1", "test2"}; | ||
24 | #endif | ||
25 | |||
26 | #if !defined(MACRO_TIMER) | ||
27 | # define MACRO_TIMER 20 | ||
28 | #endif | ||
29 | |||
30 | /* replicaJunction's process_record_user_kb */ | ||
31 | __attribute__ ((weak)) | ||
32 | bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) { | ||
33 | return true; | ||
34 | } | ||
35 | |||
36 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
37 | switch (keycode) { | ||
38 | case KC_SEC1 ... KC_SEC2: /* Secrets! Externally defined strings, not stored in repo */ | ||
39 | if (!record->event.pressed) { | ||
40 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); | ||
41 | send_string_with_delay(secrets[keycode - KC_SEC1], MACRO_TIMER); | ||
42 | } | ||
43 | return false; | ||
44 | break; | ||
45 | } | ||
46 | return process_record_user_kb(keycode, record); | ||
47 | }; | ||
48 | |||
diff --git a/users/byungyoonc/byungyoonc.h b/users/byungyoonc/byungyoonc.h new file mode 100644 index 000000000..6d82370a0 --- /dev/null +++ b/users/byungyoonc/byungyoonc.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com> | ||
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 | #pragma once | ||
18 | |||
19 | enum custom_keycodes { | ||
20 | KC_SEC1 = SAFE_RANGE, | ||
21 | KC_SEC2 | ||
22 | }; | ||
23 | |||
24 | #define KC_TASK LCTL(LSFT(KC_ESC)) | ||
25 | #define KC_MMUT LSG(KC_A) | ||
26 | |||
27 | bool process_record_user_kb(uint16_t keycode, keyrecord_t *record); | ||
diff --git a/users/byungyoonc/readme.md b/users/byungyoonc/readme.md new file mode 100644 index 000000000..d0bc8d14d --- /dev/null +++ b/users/byungyoonc/readme.md | |||
@@ -0,0 +1,14 @@ | |||
1 | byungyoonc QMK Userspace | ||
2 | ======================== | ||
3 | |||
4 | # Overview | ||
5 | Defines some custom keycodes, alongside with the Secrets feature. Also incorporates `process_record_user_kb()` for further controls. | ||
6 | |||
7 | Heavily influenced by the [Userspace code by replicaJunction](../replicaJunction/readme.md). | ||
8 | |||
9 | # Features | ||
10 | |||
11 | ## Custom Keycodes | ||
12 | - `KC_SEC#` for the Secrets input | ||
13 | - `KC_TASK` for the Windows Task Manager shortcut `LCTL(LSFT(KC_ESC))` | ||
14 | - `KC_MMUT` for the Windows PowerToys Conference Mute microphone `LSG(KC_A)` | ||
diff --git a/users/byungyoonc/rules.mk b/users/byungyoonc/rules.mk new file mode 100644 index 000000000..39c65e223 --- /dev/null +++ b/users/byungyoonc/rules.mk | |||
@@ -0,0 +1 @@ | |||
SRC += byungyoonc.c | |||
diff --git a/users/byungyoonc/saturated_solid_multisplash.h b/users/byungyoonc/saturated_solid_multisplash.h new file mode 100644 index 000000000..f30234852 --- /dev/null +++ b/users/byungyoonc/saturated_solid_multisplash.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com> | ||
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 | #if defined(RGB_MATRIX_KEYPRESSES) | ||
18 | RGB_MATRIX_EFFECT(saturated_solid_multisplash) | ||
19 | |||
20 | # if defined(RGB_MATRIX_CUSTOM_EFFECT_IMPLS) | ||
21 | |||
22 | static bool saturated_solid_multisplash(effect_params_t* params) { | ||
23 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
24 | |||
25 | uint8_t count = g_last_hit_tracker.count; | ||
26 | for (uint8_t i = led_min; i < led_max; i++) { | ||
27 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
28 | HSV hsv = rgb_matrix_config.hsv; | ||
29 | hsv.v = 0; | ||
30 | for (uint8_t j = 0; j < count; j++) { | ||
31 | int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; | ||
32 | int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; | ||
33 | uint8_t dist = sqrt16(dx * dx + dy * dy); | ||
34 | uint16_t tick = scale16by8(g_last_hit_tracker.tick[j], qadd8(rgb_matrix_config.speed, 1)); | ||
35 | |||
36 | uint16_t effect = tick - dist; | ||
37 | if (effect > 255) effect = 255; | ||
38 | uint16_t vdiff = scale16by8(255 - effect, 255 - dist); | ||
39 | hsv.v = qadd8(hsv.v, vdiff); | ||
40 | hsv.s = qsub8(hsv.s, qsub8(127, effect)); | ||
41 | } | ||
42 | hsv.v = scale8(hsv.v, rgb_matrix_config.hsv.v); | ||
43 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); | ||
44 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
45 | } | ||
46 | return led_max < DRIVER_LED_TOTAL; | ||
47 | } | ||
48 | |||
49 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
50 | #endif // RGB_MATRIX_KEYPRESSES | ||