qmk_settings: wrap tap/hold settings
This commit is contained in:
parent
6a48f2be28
commit
a284336819
3 changed files with 29 additions and 3 deletions
|
@ -482,7 +482,7 @@ endif
|
|||
ifeq ($(strip $(QMK_SETTINGS)), yes)
|
||||
AUTO_SHIFT_ENABLE := yes
|
||||
SRC += $(QUANTUM_DIR)/qmk_settings.c
|
||||
OPT_DEFS += -DQMK_SETTINGS -DAUTO_SHIFT_NO_SETUP
|
||||
OPT_DEFS += -DQMK_SETTINGS -DAUTO_SHIFT_NO_SETUP -DTAPPING_TERM_PER_KEY -DPERMISSIVE_HOLD_PER_KEY -DIGNORE_MOD_TAP_INTERRUPT_PER_KEY -DTAPPING_FORCE_HOLD_PER_KEY -DRETRO_TAPPING_PER_KEY
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "process_auto_shift.h"
|
||||
#include "mousekey.h"
|
||||
#include "process_combo.h"
|
||||
#include "action_tapping.h"
|
||||
|
||||
qmk_settings_t QS;
|
||||
|
||||
|
@ -36,6 +37,8 @@ static const qmk_settings_proto_t protos[] PROGMEM = {
|
|||
DECLARE_SETTING_CB(4, auto_shift_timeout, auto_shift_timeout_apply),
|
||||
DECLARE_SETTING(5, osk_tap_toggle),
|
||||
DECLARE_SETTING(6, osk_timeout),
|
||||
DECLARE_SETTING(7, tapping_term),
|
||||
DECLARE_SETTING(8, tapping),
|
||||
DECLARE_SETTING_CB(9, mousekey_delay, mousekey_apply),
|
||||
DECLARE_SETTING_CB(10, mousekey_interval, mousekey_apply),
|
||||
DECLARE_SETTING_CB(11, mousekey_move_delta, mousekey_apply),
|
||||
|
@ -101,6 +104,8 @@ void qmk_settings_reset(void) {
|
|||
QS.mousekey_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
|
||||
|
||||
QS.combo_term = COMBO_TERM;
|
||||
QS.tapping_term = TAPPING_TERM;
|
||||
QS.tapping = 0;
|
||||
|
||||
save_settings();
|
||||
/* to trigger all callbacks */
|
||||
|
@ -146,3 +151,23 @@ int qmk_settings_set(uint16_t qsid, const void *setting, size_t maxsz) {
|
|||
cb();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
||||
return QS.tapping_term;
|
||||
}
|
||||
|
||||
bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
|
||||
return QS.tapping & 1;
|
||||
}
|
||||
|
||||
bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
|
||||
return QS.tapping & 2;
|
||||
}
|
||||
|
||||
bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) {
|
||||
return QS.tapping & 4;
|
||||
}
|
||||
|
||||
bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) {
|
||||
return QS.tapping & 8;
|
||||
}
|
||||
|
|
|
@ -106,12 +106,13 @@ typedef struct {
|
|||
uint16_t mousekey_wheel_max_speed;
|
||||
uint16_t mousekey_wheel_time_to_max;
|
||||
uint16_t combo_term;
|
||||
uint16_t tapping_term;
|
||||
uint8_t grave_esc_override;
|
||||
uint8_t auto_shift;
|
||||
uint8_t osk_tap_toggle;
|
||||
uint8_t padding0;
|
||||
uint8_t tapping;
|
||||
} qmk_settings_t;
|
||||
_Static_assert(sizeof(qmk_settings_t) == 28, "unexpected size of the qmk_settings_t structure");
|
||||
_Static_assert(sizeof(qmk_settings_t) == 30, "unexpected size of the qmk_settings_t structure");
|
||||
|
||||
typedef void (*qmk_setting_callback_t)(void);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue