diff options
author | Choi Byungyoon <byungyoonc@gmail.com> | 2022-01-13 13:59:45 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 20:59:45 -0800 |
commit | aa9577b3714d2f0630c809df74b0a08623a9acda (patch) | |
tree | 5568d8dc155e47286e87719214dd30f7f5c03959 /users | |
parent | 731072fc5c280bb2da257b0ab2a9b601cebeb756 (diff) | |
download | qmk_firmware-aa9577b3714d2f0630c809df74b0a08623a9acda.tar.gz qmk_firmware-aa9577b3714d2f0630c809df74b0a08623a9acda.zip |
[Keymap] Add personal keymap to GMMK Pro ANSI (#15314)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'users')
-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 |
5 files changed, 140 insertions, 0 deletions
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 | ||