mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-18 05:32:05 +00:00
Add compile-time toggles for velocikey
This commit is contained in:
parent
42e839c8df
commit
e07b97f337
@ -203,12 +203,16 @@ ifeq ($(strip $(HD44780_ENABLE)), yes)
|
|||||||
OPT_DEFS += -DHD44780_ENABLE
|
OPT_DEFS += -DHD44780_ENABLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(VELOCIKEY_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DVELOCIKEY_ENABLE
|
||||||
|
SRC += $(QUANTUM_DIR)/velocikey.c
|
||||||
|
endif
|
||||||
|
|
||||||
QUANTUM_SRC:= \
|
QUANTUM_SRC:= \
|
||||||
$(QUANTUM_DIR)/quantum.c \
|
$(QUANTUM_DIR)/quantum.c \
|
||||||
$(QUANTUM_DIR)/keymap_common.c \
|
$(QUANTUM_DIR)/keymap_common.c \
|
||||||
$(QUANTUM_DIR)/keycode_config.c \
|
$(QUANTUM_DIR)/keycode_config.c \
|
||||||
$(QUANTUM_DIR)/process_keycode/process_leader.c \
|
$(QUANTUM_DIR)/process_keycode/process_leader.c
|
||||||
$(QUANTUM_DIR)/velocikey.c
|
|
||||||
|
|
||||||
ifndef CUSTOM_MATRIX
|
ifndef CUSTOM_MATRIX
|
||||||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
|
@ -198,7 +198,9 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
keypos_t key = record->event.key;
|
keypos_t key = record->event.key;
|
||||||
uint16_t keycode;
|
uint16_t keycode;
|
||||||
|
|
||||||
|
#ifdef VELOCIKEY_ENABLE
|
||||||
if (velocikey_enabled()) velocikey_accelerate();
|
if (velocikey_enabled()) velocikey_accelerate();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
|
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
|
||||||
/* TODO: Use store_or_get_action() or a similar function. */
|
/* TODO: Use store_or_get_action() or a similar function. */
|
||||||
@ -520,11 +522,13 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
#endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
#endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||||
case VLK_TOG:
|
#ifdef VELOCIKEY_ENABLE
|
||||||
if (record->event.pressed) {
|
case VLK_TOG:
|
||||||
velocikey_toggle();
|
if (record->event.pressed) {
|
||||||
}
|
velocikey_toggle();
|
||||||
return false;
|
}
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
#ifdef PROTOCOL_LUFA
|
#ifdef PROTOCOL_LUFA
|
||||||
case OUT_AUTO:
|
case OUT_AUTO:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
|
@ -606,9 +606,11 @@ void rgblight_effect_breathing(uint8_t interval) {
|
|||||||
static uint16_t last_timer = 0;
|
static uint16_t last_timer = 0;
|
||||||
float val;
|
float val;
|
||||||
|
|
||||||
uint8_t interval_time = velocikey_enabled()
|
uint8_t interval_time =
|
||||||
? velocikey_match_speed(1, 100)
|
#ifdef VELOCIKEY_ENABLE
|
||||||
: pgm_read_byte(&RGBLED_RAINBOW_SWIRL_INTERVALS[interval / 2]);
|
velocikey_enabled() ? velocikey_match_speed(1, 100) :
|
||||||
|
#endif
|
||||||
|
pgm_read_byte(&RGBLED_RAINBOW_SWIRL_INTERVALS[interval / 2]);
|
||||||
|
|
||||||
if (timer_elapsed(last_timer) < interval_time) {
|
if (timer_elapsed(last_timer) < interval_time) {
|
||||||
return;
|
return;
|
||||||
@ -625,9 +627,11 @@ void rgblight_effect_rainbow_mood(uint8_t interval) {
|
|||||||
static uint16_t current_hue = 0;
|
static uint16_t current_hue = 0;
|
||||||
static uint16_t last_timer = 0;
|
static uint16_t last_timer = 0;
|
||||||
|
|
||||||
uint8_t interval_time = velocikey_enabled()
|
uint8_t interval_time =
|
||||||
? velocikey_match_speed(5, 100)
|
#ifdef VELOCIKEY_ENABLE
|
||||||
: pgm_read_byte(&RGBLED_RAINBOW_MOOD_INTERVALS[interval]);
|
velocikey_enabled() ? velocikey_match_speed(5, 100) :
|
||||||
|
#endif
|
||||||
|
pgm_read_byte(&RGBLED_RAINBOW_MOOD_INTERVALS[interval]);
|
||||||
|
|
||||||
if (timer_elapsed(last_timer) < interval_time) {
|
if (timer_elapsed(last_timer) < interval_time) {
|
||||||
return;
|
return;
|
||||||
@ -642,9 +646,11 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) {
|
|||||||
uint16_t hue;
|
uint16_t hue;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
uint8_t interval_time = velocikey_enabled()
|
uint8_t interval_time =
|
||||||
? velocikey_match_speed(1, 100)
|
#ifdef VELOCIKEY_ENABLE
|
||||||
: pgm_read_byte(&RGBLED_RAINBOW_SWIRL_INTERVALS[interval / 2]);
|
velocikey_enabled() ? velocikey_match_speed(1, 100) :
|
||||||
|
#endif
|
||||||
|
pgm_read_byte(&RGBLED_RAINBOW_SWIRL_INTERVALS[interval / 2]);
|
||||||
|
|
||||||
if (timer_elapsed(last_timer) < interval_time) {
|
if (timer_elapsed(last_timer) < interval_time) {
|
||||||
return;
|
return;
|
||||||
@ -676,9 +682,11 @@ void rgblight_effect_snake(uint8_t interval) {
|
|||||||
increment = -1;
|
increment = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t interval_time = velocikey_enabled()
|
uint8_t interval_time =
|
||||||
? velocikey_match_speed(1, 200)
|
#ifdef VELOCIKEY_ENABLE
|
||||||
: pgm_read_byte(&RGBLED_SNAKE_INTERVALS[interval / 2]);
|
velocikey_enabled() ? velocikey_match_speed(1, 200) :
|
||||||
|
#endif
|
||||||
|
pgm_read_byte(&RGBLED_SNAKE_INTERVALS[interval / 2]);
|
||||||
|
|
||||||
if (timer_elapsed(last_timer) < interval_time) {
|
if (timer_elapsed(last_timer) < interval_time) {
|
||||||
return;
|
return;
|
||||||
@ -712,9 +720,11 @@ void rgblight_effect_snake(uint8_t interval) {
|
|||||||
void rgblight_effect_knight(uint8_t interval) {
|
void rgblight_effect_knight(uint8_t interval) {
|
||||||
static uint16_t last_timer = 0;
|
static uint16_t last_timer = 0;
|
||||||
|
|
||||||
uint8_t interval_time = velocikey_enabled()
|
uint8_t interval_time =
|
||||||
? velocikey_match_speed(5, 100)
|
#ifdef VELOCIKEY_ENABLE
|
||||||
: pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval]);
|
velocikey_enabled() ? velocikey_match_speed(5, 100) :
|
||||||
|
#endif
|
||||||
|
pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval]);
|
||||||
|
|
||||||
if (timer_elapsed(last_timer) < interval_time) {
|
if (timer_elapsed(last_timer) < interval_time) {
|
||||||
return;
|
return;
|
||||||
|
@ -1075,7 +1075,9 @@ int main(void)
|
|||||||
MIDI_Device_USBTask(&USB_MIDI_Interface);
|
MIDI_Device_USBTask(&USB_MIDI_Interface);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VELOCIKEY_ENABLE
|
||||||
if (velocikey_enabled()) velocikey_decay_task();
|
if (velocikey_enabled()) velocikey_decay_task();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE)
|
#if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE)
|
||||||
rgblight_task();
|
rgblight_task();
|
||||||
|
Loading…
Reference in New Issue
Block a user