[MERGE] Update tractyl
This commit is contained in:
parent
b09ff15d8e
commit
3009a2e152
3 changed files with 24 additions and 25 deletions
|
@ -24,20 +24,16 @@ bool usb_vbus_state(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USER_BUTTON_PIN
|
||||||
void user_button_init(void) {
|
void user_button_init(void) {
|
||||||
// Pin needs to be configured as input low
|
// Pin needs to be configured as input low
|
||||||
#ifdef USER_BUTTON_PIN
|
|
||||||
gpio_set_pin_input_low(USER_BUTTON_PIN);
|
gpio_set_pin_input_low(USER_BUTTON_PIN);
|
||||||
#endif // USER_BUTTON_PIN
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool check_user_button_state(void) {
|
bool check_user_button_state(void) {
|
||||||
gpio_write_pin(DEBUG_LED_PIN, is_keyboard_master());
|
|
||||||
#ifdef USER_BUTTON_PIN
|
|
||||||
return gpio_read_pin(USER_BUTTON_PIN);
|
return gpio_read_pin(USER_BUTTON_PIN);
|
||||||
#endif // USER_BUTTON_PIN
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
#endif // USER_BUTTON_PIN
|
||||||
|
|
||||||
void board_init(void) {
|
void board_init(void) {
|
||||||
// Board setup sets these pins as SPI, but we aren't using them as such.
|
// Board setup sets these pins as SPI, but we aren't using them as such.
|
||||||
|
|
|
@ -358,17 +358,22 @@ void keyboard_pre_init_kb(void) {
|
||||||
keyboard_pre_init_user();
|
keyboard_pre_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) void execute_user_button_action(void) {
|
__attribute__((weak)) void execute_user_button_action(bool state) {
|
||||||
|
if (state) {
|
||||||
if (is_keyboard_master()) {
|
if (is_keyboard_master()) {
|
||||||
reset_keyboard();
|
reset_keyboard();
|
||||||
} else {
|
} else {
|
||||||
soft_reset_keyboard();
|
soft_reset_keyboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void housekeeping_task_kb(void) {
|
void housekeeping_task_kb(void) {
|
||||||
if (check_user_button_state()) {
|
static bool last_state = false;
|
||||||
execute_user_button_action();
|
bool state = check_user_button_state();
|
||||||
|
if (state != last_state) {
|
||||||
|
last_state = state;
|
||||||
|
execute_user_button_action(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef POINTING_DEVICE_ENABLE
|
#ifdef POINTING_DEVICE_ENABLE
|
||||||
|
|
|
@ -28,6 +28,7 @@ enum charybdis_keycodes {
|
||||||
DRAGSCROLL_MODE,
|
DRAGSCROLL_MODE,
|
||||||
DRAGSCROLL_MODE_TOGGLE,
|
DRAGSCROLL_MODE_TOGGLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
|
#define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
|
||||||
#define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE
|
#define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE
|
||||||
#define S_D_MOD POINTER_SNIPING_DPI_FORWARD
|
#define S_D_MOD POINTER_SNIPING_DPI_FORWARD
|
||||||
|
@ -104,6 +105,3 @@ bool charybdis_get_pointer_dragscroll_enabled(void);
|
||||||
*/
|
*/
|
||||||
void charybdis_set_pointer_dragscroll_enabled(bool enable);
|
void charybdis_set_pointer_dragscroll_enabled(bool enable);
|
||||||
#endif // POINTING_DEVICE_ENABLE
|
#endif // POINTING_DEVICE_ENABLE
|
||||||
|
|
||||||
void matrix_init_sub_kb(void);
|
|
||||||
void matrix_scan_sub_kb(void);
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue