[Keymap] Update to Drashna Code (#14644)

This commit is contained in:
Drashna Jaelre 2021-09-29 11:16:11 -07:00 committed by GitHub
parent 929d959ef9
commit 1e54796f0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 180 additions and 51 deletions

View file

@ -23,7 +23,8 @@ extern unicode_config_t unicode_config;
#endif
#ifdef AUDIO_ENABLE
# include "audio.h"
extern bool delayed_tasks_run;
extern audio_config_t audio_config;
extern bool delayed_tasks_run;
#endif
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
extern bool tap_toggling;
@ -33,14 +34,6 @@ extern bool swap_hands;
#endif
extern userspace_config_t userspace_config;
__attribute__((aligned(8))) typedef struct {
bool audio_enable;
bool audio_clicky_enable;
bool tap_toggling;
bool unicode_mode;
bool swap_hands;
} user_runtime_config_t;
uint16_t transport_keymap_config = 0;
uint32_t transport_userspace_config = 0;
@ -80,34 +73,18 @@ void user_transport_update(void) {
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
user_state.tap_toggling = tap_toggling;
#endif
#ifdef UNICODE_ENABLE
user_state.unicode_mode = unicode_config.input_mode;
#endif
#ifdef SWAP_HANDS_ENABLE
user_state.swap_hands = swap_hands;
#endif
} else {
keymap_config.raw = transport_keymap_config;
userspace_config.raw = transport_userspace_config;
#ifdef UNICODE_ENABLE
unicode_config.input_mode = user_state.unicode_mode;
#endif
#ifdef AUDIO_ENABLE
if (delayed_tasks_run) {
if (user_state.audio_enable != is_audio_on()) {
if (user_state.audio_enable) {
audio_on();
} else {
audio_off();
}
}
if (user_state.audio_clicky_enable != is_clicky_on()) {
if (user_state.audio_clicky_enable) {
clicky_on();
} else {
clicky_off();
}
}
}
#endif
#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
tap_toggling = user_state.tap_toggling;
#endif