summaryrefslogtreecommitdiff
path: root/users/byungyoonc
diff options
context:
space:
mode:
authorChoi Byungyoon <byungyoonc@gmail.com>2022-01-13 13:59:45 +0900
committerGitHub <noreply@github.com>2022-01-12 20:59:45 -0800
commitaa9577b3714d2f0630c809df74b0a08623a9acda (patch)
tree5568d8dc155e47286e87719214dd30f7f5c03959 /users/byungyoonc
parent731072fc5c280bb2da257b0ab2a9b601cebeb756 (diff)
[Keymap] Add personal keymap to GMMK Pro ANSI (#15314)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'users/byungyoonc')
-rw-r--r--users/byungyoonc/byungyoonc.c48
-rw-r--r--users/byungyoonc/byungyoonc.h27
-rw-r--r--users/byungyoonc/readme.md14
-rw-r--r--users/byungyoonc/rules.mk1
-rw-r--r--users/byungyoonc/saturated_solid_multisplash.h50
5 files changed, 140 insertions, 0 deletions
diff --git a/users/byungyoonc/byungyoonc.c b/users/byungyoonc/byungyoonc.c
new file mode 100644
index 0000000000..5059de0d97
--- /dev/null
+++ b/users/byungyoonc/byungyoonc.c
@@ -0,0 +1,48 @@
+/* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include QMK_KEYBOARD_H
+#include "byungyoonc.h"
+
+#if (__has_include("secrets.h") && !defined(NO_SECRETS))
+# include "secrets.h"
+#else
+static const char *const secrets[] = {"test1", "test2"};
+#endif
+
+#if !defined(MACRO_TIMER)
+# define MACRO_TIMER 20
+#endif
+
+/* replicaJunction's process_record_user_kb */
+__attribute__ ((weak))
+bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case KC_SEC1 ... KC_SEC2: /* Secrets! Externally defined strings, not stored in repo */
+ if (!record->event.pressed) {
+ clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
+ send_string_with_delay(secrets[keycode - KC_SEC1], MACRO_TIMER);
+ }
+ return false;
+ break;
+ }
+ return process_record_user_kb(keycode, record);
+};
+
diff --git a/users/byungyoonc/byungyoonc.h b/users/byungyoonc/byungyoonc.h
new file mode 100644
index 0000000000..6d82370a01
--- /dev/null
+++ b/users/byungyoonc/byungyoonc.h
@@ -0,0 +1,27 @@
+/* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+enum custom_keycodes {
+ KC_SEC1 = SAFE_RANGE,
+ KC_SEC2
+};
+
+#define KC_TASK LCTL(LSFT(KC_ESC))
+#define KC_MMUT LSG(KC_A)
+
+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 0000000000..d0bc8d14d4
--- /dev/null
+++ b/users/byungyoonc/readme.md
@@ -0,0 +1,14 @@
+byungyoonc QMK Userspace
+========================
+
+# Overview
+Defines some custom keycodes, alongside with the Secrets feature. Also incorporates `process_record_user_kb()` for further controls.
+
+Heavily influenced by the [Userspace code by replicaJunction](../replicaJunction/readme.md).
+
+# Features
+
+## Custom Keycodes
+- `KC_SEC#` for the Secrets input
+- `KC_TASK` for the Windows Task Manager shortcut `LCTL(LSFT(KC_ESC))`
+- `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 0000000000..39c65e2238
--- /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 0000000000..f302348524
--- /dev/null
+++ b/users/byungyoonc/saturated_solid_multisplash.h
@@ -0,0 +1,50 @@
+/* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#if defined(RGB_MATRIX_KEYPRESSES)
+RGB_MATRIX_EFFECT(saturated_solid_multisplash)
+
+# if defined(RGB_MATRIX_CUSTOM_EFFECT_IMPLS)
+
+static bool saturated_solid_multisplash(effect_params_t* params) {
+ RGB_MATRIX_USE_LIMITS(led_min, led_max);
+
+ uint8_t count = g_last_hit_tracker.count;
+ for (uint8_t i = led_min; i < led_max; i++) {
+ RGB_MATRIX_TEST_LED_FLAGS();
+ HSV hsv = rgb_matrix_config.hsv;
+ hsv.v = 0;
+ for (uint8_t j = 0; j < count; j++) {
+ int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j];
+ int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j];
+ uint8_t dist = sqrt16(dx * dx + dy * dy);
+ uint16_t tick = scale16by8(g_last_hit_tracker.tick[j], qadd8(rgb_matrix_config.speed, 1));
+
+ uint16_t effect = tick - dist;
+ if (effect > 255) effect = 255;
+ uint16_t vdiff = scale16by8(255 - effect, 255 - dist);
+ hsv.v = qadd8(hsv.v, vdiff);
+ hsv.s = qsub8(hsv.s, qsub8(127, effect));
+ }
+ hsv.v = scale8(hsv.v, rgb_matrix_config.hsv.v);
+ RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
+ rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
+ }
+ return led_max < DRIVER_LED_TOTAL;
+}
+
+# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
+#endif // RGB_MATRIX_KEYPRESSES