diff options
-rw-r--r-- | src/keymaps/soispha/keymap.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/keymaps/soispha/keymap.c b/src/keymaps/soispha/keymap.c index 2b6c16f..7b8c14d 100644 --- a/src/keymaps/soispha/keymap.c +++ b/src/keymaps/soispha/keymap.c @@ -10,12 +10,12 @@ * If not, see <https://www.gnu.org/licenses/agpl.txt>. */ +#include "hid/hid.h" #include "layout/layout.h" #include "macros.h" #include "version.h" #include <stdbool.h> #include <stdint.h> -#include "hid/hid.h" bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -82,8 +82,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; } - if (keycode >= UK_UNICODE && keycode <= UK_UNICODE_MAX) { + uint8_t unicode_saved_mods; + // led_t unicode_saved_led_state; + if (keycode >= UK_UNICODE && keycode <= UK_UNICODE_MAX && + record->event.pressed) { + + // unicode_saved_led_state = host_keyboard_led_state(); + // + // // Note the order matters here! + // // Need to do this before we mess around with the mods, or else + // // UNICODE_KEY_LNX (which is usually Ctrl-Shift-U) might not work + // // correctly in the shifted case. + // if (unicode_saved_led_state.caps_lock) { + // tap_code(KC_CAPS_LOCK); + // } + + unicode_saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + clear_weak_mods(); + + tap_code16(HYPR(KC_Z)); + + // Give the pc time to start our application + wait_ms(10); + hid_send(QK_UNICODE_GET_CODE_POINT(keycode)); + + // if (unicode_saved_led_state.caps_lock) { + // tap_code(KC_CAPS_LOCK); + // } + set_mods(unicode_saved_mods); // Reregister previously set mods + + return false; } return true; |