From 9d801cb03db7d5f11d1b82a22f401e30c343d0ee Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 28 Dec 2021 20:25:06 -0800 Subject: [Keyboard] Update Tractyl Manuform to use Split Pointing Device Sync --- .../handwired/tractyl_manuform/5x6_right/config.h | 1 - .../5x6_right/keymaps/drashna/keymap.c | 2 +- .../handwired/tractyl_manuform/5x6_right/rules.mk | 2 - keyboards/handwired/tractyl_manuform/config.h | 5 +- keyboards/handwired/tractyl_manuform/tm_sync.c | 180 --------------------- .../handwired/tractyl_manuform/tractyl_manuform.c | 56 +++++-- .../handwired/tractyl_manuform/tractyl_manuform.h | 15 +- 7 files changed, 57 insertions(+), 204 deletions(-) delete mode 100644 keyboards/handwired/tractyl_manuform/tm_sync.c (limited to 'keyboards/handwired/tractyl_manuform') diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/config.h index d7618912f7..b9d8e86c09 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/config.h @@ -52,5 +52,4 @@ along with this program. If not, see . #define OLED_DISPLAY_128X64 -#define POINTING_DEVICE_TASK_THROTTLE #define POINTING_DEVICE_RIGHT diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index 958f694172..65f8a5260d 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -301,7 +301,7 @@ void oled_driver_render_logo_left(void) { # endif oled_set_cursor(6, 3); # if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) - render_pointing_dpi_status(0); + render_pointing_dpi_status(kb_config_data.device_cpi, 0); # endif oled_set_cursor(0, 4); } diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk index 37bbbb4dae..a689be3dd5 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk @@ -18,6 +18,4 @@ MOUSE_SHARED_EP = yes SPLIT_KEYBOARD = yes -QUANTUM_LIB_SRC += tm_sync.c - DEFAULT_FOLDER = handwired/tractyl_manuform/5x6_right/teensy2pp diff --git a/keyboards/handwired/tractyl_manuform/config.h b/keyboards/handwired/tractyl_manuform/config.h index cc8a7546f4..15c8102b8f 100644 --- a/keyboards/handwired/tractyl_manuform/config.h +++ b/keyboards/handwired/tractyl_manuform/config.h @@ -39,4 +39,7 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC, RPC_ID_POINTER_STATE_SYNC +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_TASK_THROTTLE_MS 1 + +#define SPLIT_TRANSACTION_IDS_KB RPC_ID_KB_CONFIG_SYNC diff --git a/keyboards/handwired/tractyl_manuform/tm_sync.c b/keyboards/handwired/tractyl_manuform/tm_sync.c deleted file mode 100644 index 549a17a22f..0000000000 --- a/keyboards/handwired/tractyl_manuform/tm_sync.c +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2021 Dasky (@daskygit) - - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "pointing_device.h" -#include "transactions.h" -#include -#ifdef MOUSEKEY_ENABLE -# include "mousekey.h" -#endif - -// typedef struct { -// uint16_t device_cpi; -// } kb_config_data_t; - -kb_config_data_t kb_config; -static report_mouse_t shared_mouse_report; -extern const pointing_device_driver_t pointing_device_driver; - -void kb_pointer_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - shared_mouse_report = pointing_device_driver.get_report(shared_mouse_report); - memcpy(target2initiator_buffer, &shared_mouse_report, sizeof(report_mouse_t)); - shared_mouse_report.x = 0; - shared_mouse_report.y = 0; - shared_mouse_report.h = 0; - shared_mouse_report.v = 0; -} - -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(kb_config)) { - memcpy(&kb_config, initiator2target_buffer, sizeof(kb_config)); - } - - static uint16_t cpi = 0; - // Check if the state values are different - if (cpi != kb_config.device_cpi) { - cpi = kb_config.device_cpi; - if (!is_keyboard_left()) { - pointing_device_set_cpi(cpi); - } - } -} - -void keyboard_pre_init_sync(void) { - memset(&kb_config, 0, sizeof(kb_config)); - memset(&shared_mouse_report, 0, sizeof(shared_mouse_report)); -} - -void keyboard_post_init_sync(void) { - // Register keyboard state sync split transaction - transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); - transaction_register_rpc(RPC_ID_POINTER_STATE_SYNC, kb_pointer_sync_handler); -} - -void housekeeping_task_sync(void) { - if (is_keyboard_master()) { - // Keep track of the last state, so that we can tell if we need to propagate to slave - static kb_config_data_t last_kb_config; - static uint32_t last_sync = 0; - bool needs_sync = false; - - // Check if the state values are different - if (memcmp(&kb_config, &last_kb_config, sizeof(kb_config))) { - needs_sync = true; - memcpy(&last_kb_config, &kb_config, sizeof(kb_config)); - } - // Send to slave every 500ms regardless of state change - if (timer_elapsed32(last_sync) > 500) { - needs_sync = true; - } - - // Perform the sync if requested - if (needs_sync) { - if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config), &kb_config)) { - last_sync = timer_read32(); - } - } - } -} - -void trackball_set_cpi(uint16_t cpi) { - kb_config.device_cpi = cpi; - if (!is_keyboard_left()) { - pointing_device_set_cpi(cpi); - } -} - -void pointing_device_task(void) { - if (!is_keyboard_master()) { - return; - } - -#if defined(POINTING_DEVICE_TASK_THROTTLE) - static uint32_t last_exec = 0; - if (timer_elapsed32(last_exec) < 1) { - return; - } - last_exec = timer_read32(); -#endif - - report_mouse_t local_report = pointing_device_get_report(); - - // Gather report info -#ifdef POINTING_DEVICE_MOTION_PIN - if (!readPin(POINTING_DEVICE_MOTION_PIN)) -#endif -#if defined(POINTING_DEVICE_COMBINED) - local_report = pointing_device_driver.get_report(local_report); - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &shared_mouse_report); - local_report.x = local_report.x | shared_mouse_report.x; - local_report.y = local_report.y | shared_mouse_report.y; - local_report.h = local_report.h | shared_mouse_report.h; - local_report.v = local_report.v | shared_mouse_report.v; -#elif defined(POINTING_DEVICE_LEFT) - if (is_keyboard_left()) { - local_report = pointing_device_driver.get_report(local_report); - } else { - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &local_report); - } -#elif defined(POINTING_DEVICE_RIGHT) - if (!is_keyboard_left()) { - local_report = pointing_device_driver.get_report(local_report); - } else { - transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(report_mouse_t), &local_report); - } -#else -# error "You need to define the side(s) the pointing device is on. POINTING_DEVICE_COMBINED / POINTING_DEVICE_LEFT / POINTING_DEVICE_RIGHT" -#endif - - // Support rotation of the sensor data -#if defined(POINTING_DEVICE_ROTATION_90) || defined(POINTING_DEVICE_ROTATION_180) || defined(POINTING_DEVICE_ROTATION_270) - int8_t x = local_report.x, y = local_report.y; -# if defined(POINTING_DEVICE_ROTATION_90) - local_report.x = y; - local_report.y = -x; -# elif defined(POINTING_DEVICE_ROTATION_180) - local_report.x = -x; - local_report.y = -y; -# elif defined(POINTING_DEVICE_ROTATION_270) - local_report.x = -y; - local_report.y = x; -# else -# error "How the heck did you get here?!" -# endif -#endif - // Support Inverting the X and Y Axises -#if defined(POINTING_DEVICE_INVERT_X) - local_report.x = -local_report.x; -#endif -#if defined(POINTING_DEVICE_INVERT_Y) - local_report.y = -local_report.y; -#endif - - // allow kb to intercept and modify report - local_report = pointing_device_task_kb(local_report); - // combine with mouse report to ensure that the combined is sent correctly -#ifdef MOUSEKEY_ENABLE - report_mouse_t mousekey_report = mousekey_get_report(); - local_report.buttons = local_report.buttons | mousekey_report.buttons; -#endif -#if defined(POINTING_DEVICE_COMBINED) - local_report.buttons = local_report.buttons | shared_mouse_report.buttons; -#endif - pointing_device_set_report(local_report); - pointing_device_send(); -} diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 6095bfb7e2..5bdc57ca09 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -17,7 +17,6 @@ #include "tractyl_manuform.h" #include "transactions.h" #include -#include "drivers/sensors/pmw3360.h" #ifndef TRACKBALL_DPI_OPTIONS # define TRACKBALL_DPI_OPTIONS \ @@ -31,11 +30,10 @@ #endif keyboard_config_t keyboard_config; +kb_config_data_t kb_config_data; uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; #define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) - - bool process_record_kb(uint16_t keycode, keyrecord_t* record) { if (!process_record_user(keycode, record)) { return false; @@ -49,7 +47,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; } eeconfig_update_kb(keyboard_config.raw); - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; + pointing_device_set_cpi(kb_config_data.device_cpi); } #endif @@ -69,7 +68,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return true; } -__attribute__((weak)) void keyboard_pre_init_sync(void) {} __attribute__((weak)) void keyboard_pre_init_sub(void) {} void keyboard_pre_init_kb(void) { // debug_enable = true; @@ -83,20 +81,22 @@ void keyboard_pre_init_kb(void) { writePin(DEBUG_LED_PIN, !debug_enable); #endif + memset(&kb_config_data, 0, sizeof(kb_config_data)); + keyboard_pre_init_sub(); - keyboard_pre_init_sync(); keyboard_pre_init_user(); } -__attribute__((weak)) void keyboard_post_init_sync(void) {} -void keyboard_post_init_kb(void) { - keyboard_post_init_sync(); +void keyboard_post_init_kb(void) { + transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); + keyboard_post_init_user(); } #ifdef POINTING_DEVICE_ENABLE void pointing_device_init_kb(void) { - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; + pointing_device_set_cpi(kb_config_data.device_cpi); pointing_device_init_user(); } @@ -111,7 +111,8 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { void eeconfig_init_kb(void) { keyboard_config.dpi_config = TRACKBALL_DPI_DEFAULT; #ifdef POINTING_DEVICE_ENABLE - trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); + kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; + pointing_device_set_cpi(kb_config_data.device_cpi); #endif eeconfig_update_kb(keyboard_config.raw); eeconfig_init_user(); @@ -135,12 +136,39 @@ void matrix_scan_kb(void) { matrix_scan_user(); } -__attribute__((weak)) void housekeeping_task_sync(void) {} -void housekeeping_task_kb(void) { - housekeeping_task_sync(); +void housekeeping_task_kb(void) { + if (is_keyboard_master()) { + // Keep track of the last state, so that we can tell if we need to propagate to slave + static kb_config_data_t last_kb_config; + static uint32_t last_sync = 0; + bool needs_sync = false; + + // Check if the state values are different + if (memcmp(&kb_config_data, &last_kb_config, sizeof(kb_config_data))) { + needs_sync = true; + memcpy(&last_kb_config, &kb_config_data, sizeof(kb_config_data)); + } + // Send to slave every 500ms regardless of state change + if (timer_elapsed32(last_sync) > 500) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config_data), &kb_config_data)) { + last_sync = timer_read32(); + } + } + } // no need for user function, is called already } +void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(kb_config_data)) { + memcpy(&kb_config_data, initiator2target_buffer, sizeof(kb_config_data)); + } +} + #ifdef POINTING_DEVICE_ENABLE void matrix_power_up(void) { pointing_device_task(); } #endif diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index 6aa40fc18b..3f8aca4551 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -32,21 +32,26 @@ typedef union { }; } keyboard_config_t; +typedef union { + uint32_t raw; + struct { + uint16_t device_cpi; + }; +} kb_config_data_t; + extern keyboard_config_t keyboard_config; +extern kb_config_data_t kb_config_data; enum ploopy_keycodes { DPI_CONFIG = SAFE_RANGE, KEYMAP_SAFE_RANGE, }; -typedef struct { - uint16_t device_cpi; -} kb_config_data_t; - -void trackball_set_cpi(uint16_t cpi); void matrix_init_sub_kb(void); void matrix_scan_sub_kb(void); void keyboard_pre_init_sync(void); void keyboard_post_init_sync(void); void housekeeping_task_sync(void); + +void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer); -- cgit v1.2.3 From f85b945c328ee5a26a8f6ae7a34930237cf69184 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 29 Dec 2021 05:54:57 -0800 Subject: [Keyboard] Fix compiler issue with tractyl manuform 4x6 (#15646) --- keyboards/handwired/tractyl_manuform/4x6_right/rules.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'keyboards/handwired/tractyl_manuform') diff --git a/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk index e83e9a7bba..c497bb2ee8 100644 --- a/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/4x6_right/rules.mk @@ -21,9 +21,7 @@ RGB_MATRIX_DRIVER = WS2812 POINTING_DEVICE_ENABLE = yes -MOUSE_SHARED_EP = no +POINTING_DEVICE_DRIVER = pmw3360 +MOUSE_SHARED_EP = yes SPLIT_KEYBOARD = yes - -SRC += drivers/sensors/pmw3360.c -QUANTUM_LIB_SRC += spi_master.c tm_sync.c -- cgit v1.2.3 From d1cf218b9dad0d35413349e7b78ff21612958579 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 30 Jan 2022 13:29:43 -0800 Subject: [Keyboard] Overhaul Tractyl Manuform (#16134) --- .../handwired/tractyl_manuform/5x6_right/config.h | 1 - .../tractyl_manuform/5x6_right/f411/config.h | 3 +- .../5x6_right/keymaps/drashna/keymap.c | 4 +- keyboards/handwired/tractyl_manuform/config.h | 2 - .../handwired/tractyl_manuform/tractyl_manuform.c | 419 ++++++++++++++++----- .../handwired/tractyl_manuform/tractyl_manuform.h | 118 ++++-- 6 files changed, 414 insertions(+), 133 deletions(-) (limited to 'keyboards/handwired/tractyl_manuform') diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/config.h index 59cd098fdb..b4f09e5e87 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/config.h @@ -50,5 +50,4 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define POINTING_DEVICE_TASK_THROTTLE #define POINTING_DEVICE_RIGHT diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h index 6ae51ca6f0..87c3239057 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h @@ -79,7 +79,8 @@ along with this program. If not, see . #define I2C1_SDA_PIN B9 #define I2C1_SCL_PAL_MODE 4 #define I2C1_SDA_PAL_MODE 4 -// #define I2C1_CLOCK_SPEED 400000 +#define I2C1_CLOCK_SPEED 400000 +#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 /* encoder config */ #define ENCODERS_PAD_A \ diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c index fa1e8897ee..570760cf66 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -61,8 +61,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MOUSE] = LAYOUT_5x6_right( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, DPI_CONFIG, + _______, _______, _______, _______, _______, _______, KC_WH_U, DPI_MOD, DPI_RMOD,S_D_MOD, S_D_RMOD,DRGSCRL, + _______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, _______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN3, diff --git a/keyboards/handwired/tractyl_manuform/config.h b/keyboards/handwired/tractyl_manuform/config.h index 15c8102b8f..f9160ea148 100644 --- a/keyboards/handwired/tractyl_manuform/config.h +++ b/keyboards/handwired/tractyl_manuform/config.h @@ -24,8 +24,6 @@ along with this program. If not, see . #define VENDOR_ID 0x44DD #define MANUFACTURER Drashna -#define USB_POLLING_INTERVAL_MS 1 - /* disable debug print */ // #define NO_DEBUG diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index 5bdc57ca09..033146134d 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -18,135 +18,345 @@ #include "transactions.h" #include -#ifndef TRACKBALL_DPI_OPTIONS -# define TRACKBALL_DPI_OPTIONS \ - { 1200, 1600, 2400 } -# ifndef TRACKBALL_DPI_DEFAULT -# define TRACKBALL_DPI_DEFAULT 1 -# endif -#endif -#ifndef TRACKBALL_DPI_DEFAULT -# define TRACKBALL_DPI_DEFAULT 0 -#endif - -keyboard_config_t keyboard_config; -kb_config_data_t kb_config_data; -uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS; -#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t)) - -bool process_record_kb(uint16_t keycode, keyrecord_t* record) { - if (!process_record_user(keycode, record)) { - return false; - } +#ifdef CONSOLE_ENABLE +# include "print.h" +#endif // CONSOLE_ENABLE #ifdef POINTING_DEVICE_ENABLE - if (keycode == DPI_CONFIG && record->event.pressed) { - if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { - keyboard_config.dpi_config = (keyboard_config.dpi_config - 1) % DPI_OPTION_SIZE; - } else { - keyboard_config.dpi_config = (keyboard_config.dpi_config + 1) % DPI_OPTION_SIZE; - } - eeconfig_update_kb(keyboard_config.raw); - kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; - pointing_device_set_cpi(kb_config_data.device_cpi); - } -#endif +# ifndef CHARYBDIS_MINIMUM_DEFAULT_DPI +# define CHARYBDIS_MINIMUM_DEFAULT_DPI 400 +# endif // CHARYBDIS_MINIMUM_DEFAULT_DPI + +# ifndef CHARYBDIS_DEFAULT_DPI_CONFIG_STEP +# define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200 +# endif // CHARYBDIS_DEFAULT_DPI_CONFIG_STEP + +# ifndef CHARYBDIS_MINIMUM_SNIPING_DPI +# define CHARYBDIS_MINIMUM_SNIPING_DPI 200 +# endif // CHARYBDIS_MINIMUM_SNIPER_MODE_DPI + +# ifndef CHARYBDIS_SNIPING_DPI_CONFIG_STEP +# define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100 +# endif // CHARYBDIS_SNIPING_DPI_CONFIG_STEP + +// Fixed DPI for drag-scroll. +# ifndef CHARYBDIS_DRAGSCROLL_DPI +# define CHARYBDIS_DRAGSCROLL_DPI 100 +# endif // CHARYBDIS_DRAGSCROLL_DPI + +# ifndef CHARYBDIS_DRAGSCROLL_BUFFER_SIZE +# define CHARYBDIS_DRAGSCROLL_BUFFER_SIZE 6 +# endif // !CHARYBDIS_DRAGSCROLL_BUFFER_SIZE + +# ifndef CHARYBDIS_POINTER_ACCELERATION_FACTOR +# define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24 +# endif // !CHARYBDIS_POINTER_ACCELERATION_FACTOR + +typedef union { + uint8_t raw; + struct { + uint8_t pointer_default_dpi : 4; // 16 steps available. + uint8_t pointer_sniping_dpi : 2; // 4 steps available. + bool is_dragscroll_enabled : 1; + bool is_sniping_enabled : 1; + } __attribute__((packed)); +} charybdis_config_t; -/* If Mousekeys is disabled, then use handle the mouse button - * keycodes. This makes things simpler, and allows usage of - * the keycodes in a consistent manner. But only do this if - * Mousekeys is not enable, so it's not handled twice. +static charybdis_config_t g_charybdis_config = {0}; + +/** + * \brief Set the value of `config` from EEPROM. + * + * Note that `is_dragscroll_enabled` and `is_sniping_enabled` are purposefully + * ignored since we do not want to persist this state to memory. In practice, + * this state is always written to maximize write-performances. Therefore, we + * explicitly set them to `false` in this function. */ -#ifndef MOUSEKEY_ENABLE - if (IS_MOUSEKEY_BUTTON(keycode)) { - report_mouse_t currentReport = pointing_device_get_report(); - currentReport.buttons = pointing_device_handle_buttons(currentReport.buttons, record->event.pressed, keycode - KC_MS_BTN1); - pointing_device_set_report(currentReport); - pointing_device_send(); +static void read_charybdis_config_from_eeprom(charybdis_config_t* config) { + config->raw = eeconfig_read_kb() & 0xff; + config->is_dragscroll_enabled = false; + config->is_sniping_enabled = false; +} + +/** + * \brief Save the value of `config` to eeprom. + * + * Note that all values are written verbatim, including whether drag-scroll + * and/or sniper mode are enabled. `read_charybdis_config_from_eeprom(…)` + * resets these 2 values to `false` since it does not make sense to persist + * these across reboots of the board. + */ +static void write_charybdis_config_to_eeprom(charybdis_config_t* config) { eeconfig_update_kb(config->raw); } + +/** \brief Return the current value of the pointer's default DPI. */ +static uint16_t get_pointer_default_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_default_dpi * CHARYBDIS_DEFAULT_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_DEFAULT_DPI; } + +/** \brief Return the current value of the pointer's sniper-mode DPI. */ +static uint16_t get_pointer_sniping_dpi(charybdis_config_t* config) { return (uint16_t)config->pointer_sniping_dpi * CHARYBDIS_SNIPING_DPI_CONFIG_STEP + CHARYBDIS_MINIMUM_SNIPING_DPI; } + +/** \brief Set the appropriate DPI for the input config. */ +static void maybe_update_pointing_device_cpi(charybdis_config_t* config) { + if (config->is_dragscroll_enabled) { + pointing_device_set_cpi(CHARYBDIS_DRAGSCROLL_DPI); + } else if (config->is_sniping_enabled) { + pointing_device_set_cpi(get_pointer_sniping_dpi(config)); + } else { + pointing_device_set_cpi(get_pointer_default_dpi(config)); } -#endif +} - return true; +/** + * \brief Update the pointer's default DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP. + */ +static void step_pointer_default_dpi(charybdis_config_t* config, bool forward) { + config->pointer_default_dpi += forward ? 1 : -1; + maybe_update_pointing_device_cpi(config); } -__attribute__((weak)) void keyboard_pre_init_sub(void) {} -void keyboard_pre_init_kb(void) { - // debug_enable = true; - // debug_matrix = true; - // debug_mouse = true; - // debug_encoder = true; - // This is the debug LED. -#if defined(DEBUG_LED_PIN) - setPinOutput(DEBUG_LED_PIN); - writePin(DEBUG_LED_PIN, !debug_enable); -#endif +/** + * \brief Update the pointer's sniper-mode DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP. + */ +static void step_pointer_sniping_dpi(charybdis_config_t* config, bool forward) { + config->pointer_sniping_dpi += forward ? 1 : -1; + maybe_update_pointing_device_cpi(config); +} + +uint16_t charybdis_get_pointer_default_dpi(void) { return get_pointer_default_dpi(&g_charybdis_config); } + +uint16_t charybdis_get_pointer_sniping_dpi(void) { return get_pointer_sniping_dpi(&g_charybdis_config); } - memset(&kb_config_data, 0, sizeof(kb_config_data)); +void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward) { step_pointer_default_dpi(&g_charybdis_config, forward); } - keyboard_pre_init_sub(); - keyboard_pre_init_user(); +void charybdis_cycle_pointer_default_dpi(bool forward) { + step_pointer_default_dpi(&g_charybdis_config, forward); + write_charybdis_config_to_eeprom(&g_charybdis_config); } -void keyboard_post_init_kb(void) { - transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler); +void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward) { step_pointer_sniping_dpi(&g_charybdis_config, forward); } - keyboard_post_init_user(); +void charybdis_cycle_pointer_sniping_dpi(bool forward) { + step_pointer_sniping_dpi(&g_charybdis_config, forward); + write_charybdis_config_to_eeprom(&g_charybdis_config); } -#ifdef POINTING_DEVICE_ENABLE -void pointing_device_init_kb(void) { - kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; - pointing_device_set_cpi(kb_config_data.device_cpi); - pointing_device_init_user(); +bool charybdis_get_pointer_sniping_enabled(void) { return g_charybdis_config.is_sniping_enabled; } + +void charybdis_set_pointer_sniping_enabled(bool enable) { + g_charybdis_config.is_sniping_enabled = enable; + maybe_update_pointing_device_cpi(&g_charybdis_config); } -report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { - if (is_keyboard_master()) { - mouse_report = pointing_device_task_user(mouse_report); +bool charybdis_get_pointer_dragscroll_enabled(void) { return g_charybdis_config.is_dragscroll_enabled; } + +void charybdis_set_pointer_dragscroll_enabled(bool enable) { + g_charybdis_config.is_dragscroll_enabled = enable; + maybe_update_pointing_device_cpi(&g_charybdis_config); +} + +void pointing_device_init_kb(void) { maybe_update_pointing_device_cpi(&g_charybdis_config); } + +# ifndef CONSTRAIN_HID +# define CONSTRAIN_HID(value) ((value) < -127 ? -127 : ((value) > 127 ? 127 : (value))) +# endif // !CONSTRAIN_HID + +/** + * \brief Add optional acceleration effect. + * + * If `CHARYBDIS_ENABLE_POINTER_ACCELERATION` is defined, add a simple and naive + * acceleration effect to the provided value. Return the value unchanged + * otherwise. + */ +# ifndef DISPLACEMENT_WITH_ACCELERATION +# ifdef CHARYBDIS_POINTER_ACCELERATION_ENABLE +# define DISPLACEMENT_WITH_ACCELERATION(d) (CONSTRAIN_HID(d > 0 ? d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d : -d * d / CHARYBDIS_POINTER_ACCELERATION_FACTOR + d)) +# else // !CHARYBDIS_POINTER_ACCELERATION_ENABLE +# define DISPLACEMENT_WITH_ACCELERATION(d) (d) +# endif // CHARYBDIS_POINTER_ACCELERATION_ENABLE +# endif // !DISPLACEMENT_WITH_ACCELERATION + +/** + * \brief Augment the pointing device behavior. + * + * Implement the Charybdis-specific features for pointing devices: + * - Drag-scroll + * - Sniping + * - Acceleration + */ +static void pointing_device_task_charybdis(report_mouse_t* mouse_report) { + static int16_t scroll_buffer_x = 0; + static int16_t scroll_buffer_y = 0; + if (g_charybdis_config.is_dragscroll_enabled) { +# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_X + scroll_buffer_x -= mouse_report->x; +# else + scroll_buffer_x += mouse_report->x; +# endif // CHARYBDIS_DRAGSCROLL_REVERSE_X +# ifdef CHARYBDIS_DRAGSCROLL_REVERSE_Y + scroll_buffer_y -= mouse_report->y; +# else + scroll_buffer_y += mouse_report->y; +# endif // CHARYBDIS_DRAGSCROLL_REVERSE_Y + mouse_report->x = 0; + mouse_report->y = 0; + if (abs(scroll_buffer_x) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) { + mouse_report->h = scroll_buffer_x > 0 ? 1 : -1; + scroll_buffer_x = 0; + } + if (abs(scroll_buffer_y) > CHARYBDIS_DRAGSCROLL_BUFFER_SIZE) { + mouse_report->v = scroll_buffer_y > 0 ? 1 : -1; + scroll_buffer_y = 0; + } + } else if (!g_charybdis_config.is_sniping_enabled) { + mouse_report->x = DISPLACEMENT_WITH_ACCELERATION(mouse_report->x); + mouse_report->y = DISPLACEMENT_WITH_ACCELERATION(mouse_report->y); } +} + +report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { + pointing_device_task_charybdis(&mouse_report); + mouse_report = pointing_device_task_user(mouse_report); + return mouse_report; } -#endif + +# if defined(POINTING_DEVICE_ENABLE) && !defined(NO_CHARYBDIS_KEYCODES) +/** \brief Whether SHIFT mod is enabled. */ +static bool has_shift_mod(void) { +# ifdef NO_ACTION_ONESHOT + return mod_config(get_mods()) & MOD_MASK_SHIFT; +# else + return mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; +# endif // NO_ACTION_ONESHOT +} +# endif // POINTING_DEVICE_ENABLE && !NO_CHARYBDIS_KEYCODES + +/** + * \brief Outputs the Charybdis configuration to console. + * + * Prints the in-memory configuration structure to console, for debugging. + * Includes: + * - raw value + * - drag-scroll: on/off + * - sniping: on/off + * - default DPI: internal table index/actual DPI + * - sniping DPI: internal table index/actual DPI + */ +static void debug_charybdis_config_to_console(charybdis_config_t* config) { +# ifdef CONSOLE_ENABLE + dprintf("(charybdis) process_record_kb: config = {\n" + "\traw = 0x%04X,\n" + "\t{\n" + "\t\tis_dragscroll_enabled=%b\n" + "\t\tis_sniping_enabled=%b\n" + "\t\tdefault_dpi=0x%02X (%ld)\n" + "\t\tsniping_dpi=0x%01X (%ld)\n" + "\t}\n" + "}\n", + config->raw, config->is_dragscroll_enabled, config->is_sniping_enabled, config->pointer_default_dpi, get_pointer_default_dpi(config), config->pointer_sniping_dpi, get_pointer_sniping_dpi(config)); +# endif // CONSOLE_ENABLE +} + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + if (!process_record_user(keycode, record)) { + debug_charybdis_config_to_console(&g_charybdis_config); + return false; + } +# ifndef NO_CHARYBDIS_KEYCODES + switch (keycode) { + case POINTER_DEFAULT_DPI_FORWARD: + if (record->event.pressed) { + // Step backward if shifted, forward otherwise. + charybdis_cycle_pointer_default_dpi(/* forward= */ !has_shift_mod()); + } + break; + case POINTER_DEFAULT_DPI_REVERSE: + if (record->event.pressed) { + // Step forward if shifted, backward otherwise. + charybdis_cycle_pointer_default_dpi(/* forward= */ has_shift_mod()); + } + break; + case POINTER_SNIPING_DPI_FORWARD: + if (record->event.pressed) { + // Step backward if shifted, forward otherwise. + charybdis_cycle_pointer_sniping_dpi(/* forward= */ !has_shift_mod()); + } + break; + case POINTER_SNIPING_DPI_REVERSE: + if (record->event.pressed) { + // Step forward if shifted, backward otherwise. + charybdis_cycle_pointer_sniping_dpi(/* forward= */ has_shift_mod()); + } + break; + case SNIPING_MODE: + charybdis_set_pointer_sniping_enabled(record->event.pressed); + break; + case SNIPING_MODE_TOGGLE: + if (record->event.pressed) { + charybdis_set_pointer_sniping_enabled(!charybdis_get_pointer_sniping_enabled()); + } + break; + case DRAGSCROLL_MODE: + charybdis_set_pointer_dragscroll_enabled(record->event.pressed); + break; + case DRAGSCROLL_MODE_TOGGLE: + if (record->event.pressed) { + charybdis_set_pointer_dragscroll_enabled(!charybdis_get_pointer_dragscroll_enabled()); + } + break; + } +# endif // !NO_CHARYBDIS_KEYCODES +# ifndef MOUSEKEY_ENABLE + // Simulate mouse keys if full support is not enabled (reduces firmware size + // while maintaining support for mouse keys). + if (IS_MOUSEKEY_BUTTON(keycode)) { + report_mouse_t mouse_report = pointing_device_get_report(); + mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, record->event.pressed, keycode - KC_MS_BTN1); + pointing_device_set_report(mouse_report); + pointing_device_send(); + } +# endif // !MOUSEKEY_ENABLE + debug_charybdis_config_to_console(&g_charybdis_config); + return true; +} void eeconfig_init_kb(void) { - keyboard_config.dpi_config = TRACKBALL_DPI_DEFAULT; -#ifdef POINTING_DEVICE_ENABLE - kb_config_data.device_cpi = dpi_array[keyboard_config.dpi_config]; - pointing_device_set_cpi(kb_config_data.device_cpi); -#endif - eeconfig_update_kb(keyboard_config.raw); + g_charybdis_config.raw = 0; + write_charybdis_config_to_eeprom(&g_charybdis_config); + maybe_update_pointing_device_cpi(&g_charybdis_config); eeconfig_init_user(); } -__attribute__((weak)) void matrix_init_sub_kb(void) {} -void matrix_init_kb(void) { - // is safe to just read DPI setting since matrix init - // comes before pointing device init. - keyboard_config.raw = eeconfig_read_kb(); - if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { - eeconfig_init_kb(); +void matrix_power_up(void) { pointing_device_task(); } + +void charybdis_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { + if (initiator2target_buffer_size == sizeof(g_charybdis_config)) { + memcpy(&g_charybdis_config, initiator2target_buffer, sizeof(g_charybdis_config)); } - matrix_init_sub_kb(); - matrix_init_user(); } -__attribute__((weak)) void matrix_scan_sub_kb(void) {} -void matrix_scan_kb(void) { - matrix_scan_sub_kb(); - matrix_scan_user(); +void keyboard_post_init_kb(void) { + transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, charybdis_config_sync_handler); + + keyboard_post_init_user(); } void housekeeping_task_kb(void) { if (is_keyboard_master()) { // Keep track of the last state, so that we can tell if we need to propagate to slave - static kb_config_data_t last_kb_config; - static uint32_t last_sync = 0; - bool needs_sync = false; + static charybdis_config_t last_charybdis_config = {0}; + static uint32_t last_sync = 0; + bool needs_sync = false; // Check if the state values are different - if (memcmp(&kb_config_data, &last_kb_config, sizeof(kb_config_data))) { + if (memcmp(&g_charybdis_config, &last_charybdis_config, sizeof(g_charybdis_config))) { needs_sync = true; - memcpy(&last_kb_config, &kb_config_data, sizeof(kb_config_data)); + memcpy(&last_charybdis_config, &g_charybdis_config, sizeof(g_charybdis_config)); } // Send to slave every 500ms regardless of state change if (timer_elapsed32(last_sync) > 500) { @@ -155,7 +365,7 @@ void housekeeping_task_kb(void) { // Perform the sync if requested if (needs_sync) { - if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(kb_config_data), &kb_config_data)) { + if (transaction_rpc_send(RPC_ID_KB_CONFIG_SYNC, sizeof(g_charybdis_config), &g_charybdis_config)) { last_sync = timer_read32(); } } @@ -163,12 +373,19 @@ void housekeeping_task_kb(void) { // no need for user function, is called already } -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { - if (initiator2target_buffer_size == sizeof(kb_config_data)) { - memcpy(&kb_config_data, initiator2target_buffer, sizeof(kb_config_data)); - } -} +#endif // POINTING_DEVICE_ENABLE +__attribute__((weak)) void matrix_init_sub_kb(void) {} +void matrix_init_kb(void) { #ifdef POINTING_DEVICE_ENABLE -void matrix_power_up(void) { pointing_device_task(); } -#endif + read_charybdis_config_from_eeprom(&g_charybdis_config); +#endif // POINTING_DEVICE_ENABLE + matrix_init_sub_kb(); + matrix_init_user(); +} + +__attribute__((weak)) void matrix_scan_sub_kb(void) {} +void matrix_scan_kb(void) { + matrix_scan_sub_kb(); + matrix_scan_user(); +} diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index 3f8aca4551..197aee985e 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -17,7 +17,6 @@ #pragma once #include "quantum.h" -#include "pointing_device.h" #if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right) # include "5x6_right.h" @@ -25,33 +24,100 @@ # include "4x6_right.h" #endif -typedef union { - uint32_t raw; - struct { - uint8_t dpi_config; - }; -} keyboard_config_t; - -typedef union { - uint32_t raw; - struct { - uint16_t device_cpi; - }; -} kb_config_data_t; - -extern keyboard_config_t keyboard_config; -extern kb_config_data_t kb_config_data; - -enum ploopy_keycodes { - DPI_CONFIG = SAFE_RANGE, +#ifdef POINTING_DEVICE_ENABLE +# ifndef NO_CHARYBDIS_KEYCODES +enum charybdis_keycodes { +# ifdef VIA_ENABLE + POINTER_DEFAULT_DPI_FORWARD = USER00, +# else + POINTER_DEFAULT_DPI_FORWARD = SAFE_RANGE, +# endif // VIA_ENABLE + POINTER_DEFAULT_DPI_REVERSE, + POINTER_SNIPING_DPI_FORWARD, + POINTER_SNIPING_DPI_REVERSE, + SNIPING_MODE, + SNIPING_MODE_TOGGLE, + DRAGSCROLL_MODE, + DRAGSCROLL_MODE_TOGGLE, KEYMAP_SAFE_RANGE, }; +# define CHARYBDIS_SAFE_RANGE KEYMAP_SAFE_RANGE +# define DPI_MOD POINTER_DEFAULT_DPI_FORWARD +# define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE +# define S_D_MOD POINTER_SNIPING_DPI_FORWARD +# define S_D_RMOD POINTER_SNIPING_DPI_REVERSE +# define SNIPING SNIPING_MODE +# define SNP_TOG SNIPING_MODE_TOGGLE +# define DRGSCRL DRAGSCROLL_MODE +# define DRG_TOG DRAGSCROLL_MODE_TOGGLE +# endif // !NO_CHARYBDIS_KEYCODES -void matrix_init_sub_kb(void); -void matrix_scan_sub_kb(void); +/** \brief Return the current DPI value for the pointer's default mode. */ +uint16_t charybdis_get_pointer_default_dpi(void); + +/** + * \brief Update the pointer's default DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_DEFAULT_DPI_CONFIG_STEP. + * + * The new value is persisted in EEPROM. + */ +void charybdis_cycle_pointer_default_dpi(bool forward); + +/** + * \brief Same as `charybdis_cycle_pointer_default_dpi`, but do not write to + * EEPROM. + * + * This means that reseting the board will revert the value to the last + * persisted one. + */ +void charybdis_cycle_pointer_default_dpi_noeeprom(bool forward); + +/** \brief Return the current DPI value for the pointer's sniper-mode. */ +uint16_t charybdis_get_pointer_sniping_dpi(void); + +/** + * \brief Update the pointer's sniper-mode DPI to the next or previous step. + * + * Increases the DPI value if `forward` is `true`, decreases it otherwise. + * The increment/decrement steps are equal to CHARYBDIS_SNIPING_DPI_CONFIG_STEP. + * + * The new value is persisted in EEPROM. + */ +void charybdis_cycle_pointer_sniping_dpi(bool forward); + +/** + * \brief Same as `charybdis_cycle_pointer_sniping_dpi`, but do not write to + * EEPROM. + * + * This means that reseting the board will revert the value to the last + * persisted one. + */ +void charybdis_cycle_pointer_sniping_dpi_noeeprom(bool forward); -void keyboard_pre_init_sync(void); -void keyboard_post_init_sync(void); -void housekeeping_task_sync(void); +/** \brief Whether sniper-mode is enabled. */ +bool charybdis_get_pointer_sniping_enabled(void); + +/** + * \brief Enable/disable sniper mode. + * + * When sniper mode is enabled the dpi is reduced to slow down the pointer for + * more accurate movements. + */ +void charybdis_set_pointer_sniping_enabled(bool enable); -void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer); +/** \brief Whether drag-scroll is enabled. */ +bool charybdis_get_pointer_dragscroll_enabled(void); + +/** + * \brief Enable/disable drag-scroll mode. + * + * When drag-scroll mode is enabled, horizontal and vertical pointer movements + * are translated into horizontal and vertical scroll movements. + */ +void charybdis_set_pointer_dragscroll_enabled(bool enable); +#endif // POINTING_DEVICE_ENABLE + +void matrix_init_sub_kb(void); +void matrix_scan_sub_kb(void); -- cgit v1.2.3