mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-24 09:51:54 +02:00
Merge remote-tracking branch 'upstream/develop' into xap
This commit is contained in:
+42
-12
@@ -47,7 +47,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
int tp_buttons;
|
||||
|
||||
#if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
int retro_tapping_counter = 0;
|
||||
bool retro_tap_primed = false;
|
||||
uint16_t retro_tap_curr_key = 0;
|
||||
# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
uint8_t retro_tap_curr_mods = 0;
|
||||
uint8_t retro_tap_next_mods = 0;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING)
|
||||
@@ -77,7 +82,13 @@ void action_exec(keyevent_t event) {
|
||||
debug_event(event);
|
||||
ac_dprintf("\n");
|
||||
#if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
retro_tapping_counter++;
|
||||
uint16_t event_keycode = get_event_keycode(event, false);
|
||||
if (event.pressed) {
|
||||
retro_tap_primed = false;
|
||||
retro_tap_curr_key = event_keycode;
|
||||
} else if (retro_tap_curr_key == event_keycode) {
|
||||
retro_tap_primed = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -531,7 +542,8 @@ void process_action(keyrecord_t *record, action_t action) {
|
||||
# if defined(RETRO_TAPPING) && defined(DUMMY_MOD_NEUTRALIZER_KEYCODE)
|
||||
// Send a dummy keycode to neutralize flashing modifiers
|
||||
// if the key was held and then released with no interruptions.
|
||||
if (retro_tapping_counter == 2) {
|
||||
uint16_t ev_kc = get_event_keycode(event, false);
|
||||
if (retro_tap_primed && retro_tap_curr_key == ev_kc) {
|
||||
neutralize_flashing_modifiers(get_mods());
|
||||
}
|
||||
# endif
|
||||
@@ -817,6 +829,10 @@ void process_action(keyrecord_t *record, action_t action) {
|
||||
case ACT_LAYER_TAP_EXT:
|
||||
# endif
|
||||
led_set(host_keyboard_leds());
|
||||
# ifndef NO_ACTION_ONESHOT
|
||||
// don't release the key
|
||||
do_release_oneshot = false;
|
||||
# endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -825,30 +841,44 @@ void process_action(keyrecord_t *record, action_t action) {
|
||||
|
||||
#ifndef NO_ACTION_TAPPING
|
||||
# if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) || (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
if (!is_tap_action(action)) {
|
||||
retro_tapping_counter = 0;
|
||||
} else {
|
||||
if (is_tap_action(action)) {
|
||||
if (event.pressed) {
|
||||
if (tap_count > 0) {
|
||||
retro_tapping_counter = 0;
|
||||
retro_tap_primed = false;
|
||||
} else {
|
||||
# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
retro_tap_curr_mods = retro_tap_next_mods;
|
||||
retro_tap_next_mods = get_mods();
|
||||
# endif
|
||||
}
|
||||
} else {
|
||||
uint16_t event_keycode = get_event_keycode(event, false);
|
||||
# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
uint8_t curr_mods = get_mods();
|
||||
# endif
|
||||
if (tap_count > 0) {
|
||||
retro_tapping_counter = 0;
|
||||
} else {
|
||||
retro_tap_primed = false;
|
||||
} else if (retro_tap_curr_key == event_keycode) {
|
||||
if (
|
||||
# ifdef RETRO_TAPPING_PER_KEY
|
||||
get_retro_tapping(get_event_keycode(record->event, false), record) &&
|
||||
get_retro_tapping(event_keycode, record) &&
|
||||
# endif
|
||||
retro_tapping_counter == 2) {
|
||||
retro_tap_primed) {
|
||||
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
|
||||
process_auto_shift(action.layer_tap.code, record);
|
||||
# else
|
||||
register_mods(retro_tap_curr_mods);
|
||||
wait_ms(TAP_CODE_DELAY);
|
||||
tap_code(action.layer_tap.code);
|
||||
wait_ms(TAP_CODE_DELAY);
|
||||
unregister_mods(retro_tap_curr_mods);
|
||||
# endif
|
||||
}
|
||||
retro_tapping_counter = 0;
|
||||
retro_tap_primed = false;
|
||||
}
|
||||
# if !(defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
|
||||
retro_tap_next_mods = curr_mods;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
@@ -557,6 +557,12 @@ int16_t qp_drawtext_recolor(painter_device_t device, uint16_t x, uint16_t y, pai
|
||||
# define SH1106_NUM_DEVICES 0
|
||||
#endif // QUANTUM_PAINTER_SH1106_ENABLE
|
||||
|
||||
#ifdef QUANTUM_PAINTER_SH1107_ENABLE
|
||||
# include "qp_sh1107.h"
|
||||
#else // QUANTUM_PAINTER_SH1107_ENABLE
|
||||
# define SH1107_NUM_DEVICES 0
|
||||
#endif // QUANTUM_PAINTER_SH1107_ENABLE
|
||||
|
||||
#ifdef QUANTUM_PAINTER_LD7032_ENABLE
|
||||
# include "qp_ld7032.h"
|
||||
#else // QUANTUM_PAINTER_LD7032_ENABLE
|
||||
|
||||
@@ -19,6 +19,7 @@ enum {
|
||||
+ (GC9107_NUM_DEVICES) // GC9107
|
||||
+ (SSD1351_NUM_DEVICES) // SSD1351
|
||||
+ (SH1106_NUM_DEVICES) // SH1106
|
||||
+ (SH1107_NUM_DEVICES) // SH1107
|
||||
+ (LD7032_NUM_DEVICES) // LD7032
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ VALID_QUANTUM_PAINTER_DRIVERS := \
|
||||
ssd1351_spi \
|
||||
sh1106_i2c \
|
||||
sh1106_spi \
|
||||
sh1107_i2c \
|
||||
sh1107_spi \
|
||||
ld7032_i2c \
|
||||
ld7032_spi
|
||||
|
||||
@@ -184,6 +186,29 @@ define handle_quantum_painter_driver
|
||||
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
||||
$(DRIVER_PATH)/painter/sh1106/qp_sh1106.c
|
||||
|
||||
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1107_spi)
|
||||
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
||||
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
||||
QUANTUM_PAINTER_NEEDS_COMMS_SPI_DC_RESET := yes
|
||||
OPT_DEFS += -DQUANTUM_PAINTER_SH1107_ENABLE -DQUANTUM_PAINTER_SH1107_SPI_ENABLE
|
||||
COMMON_VPATH += \
|
||||
$(DRIVER_PATH)/painter/oled_panel \
|
||||
$(DRIVER_PATH)/painter/sh1107
|
||||
SRC += \
|
||||
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
||||
$(DRIVER_PATH)/painter/sh1107/qp_sh1107.c
|
||||
|
||||
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),sh1107_i2c)
|
||||
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
||||
QUANTUM_PAINTER_NEEDS_COMMS_I2C := yes
|
||||
OPT_DEFS += -DQUANTUM_PAINTER_SH1107_ENABLE -DQUANTUM_PAINTER_SH1107_I2C_ENABLE
|
||||
COMMON_VPATH += \
|
||||
$(DRIVER_PATH)/painter/oled_panel \
|
||||
$(DRIVER_PATH)/painter/sh1107
|
||||
SRC += \
|
||||
$(DRIVER_PATH)/painter/oled_panel/qp_oled_panel.c \
|
||||
$(DRIVER_PATH)/painter/sh1107/qp_sh1107.c
|
||||
|
||||
else ifeq ($$(strip $$(CURRENT_PAINTER_DRIVER)),ld7032_spi)
|
||||
QUANTUM_PAINTER_NEEDS_SURFACE := yes
|
||||
QUANTUM_PAINTER_NEEDS_COMMS_SPI := yes
|
||||
|
||||
Reference in New Issue
Block a user