From 56e3f06a26851976e559aacf7a096c61403304be Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 14 Nov 2021 22:03:24 -0800 Subject: Rework and expand Pointing Device support (#14343) Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> --- keyboards/handwired/tractyl_manuform/5x6_right/config.h | 1 + .../tractyl_manuform/5x6_right/keymaps/drashna/keymap.c | 11 ++++++++--- keyboards/handwired/tractyl_manuform/5x6_right/rules.mk | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'keyboards/handwired/tractyl_manuform/5x6_right') diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/config.h index ce35197f71..6f702bd59e 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/config.h +++ b/keyboards/handwired/tractyl_manuform/5x6_right/config.h @@ -31,6 +31,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define ROTATIONAL_TRANSFORM_ANGLE -25 +#define POINTING_DEVICE_INVERT_X /* Bootmagic Lite key configuration */ #define BOOTMAGIC_LITE_ROW 0 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 5bfc21fd14..1275950766 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/keymap.c @@ -174,7 +174,11 @@ bool tap_toggling = false; # define TAP_CHECK TAPPING_TERM # endif -void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y) { +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + int8_t x = mouse_report.x, y = mouse_report.y; + mouse_report.x = 0; + mouse_report.y = 0; + if (x != 0 && y != 0) { mouse_timer = timer_read(); # ifdef OLED_ENABLE @@ -185,13 +189,14 @@ void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y) { x = (x > 0 ? x * x / 16 + x : -x * x / 16 + x); y = (y > 0 ? y * y / 16 + y : -y * y / 16 + y); } - mouse_report->x = x; - mouse_report->y = y; + mouse_report.x = x; + mouse_report.y = y; if (!layer_state_is(_MOUSE)) { layer_on(_MOUSE); } } } + return mouse_report; } void matrix_scan_keymap(void) { diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk index c9bc2dbb99..699e826485 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/rules.mk @@ -16,11 +16,11 @@ AUDIO_ENABLE = no # Audio output SWAP_HANDS_ENABLE = yes POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = pmw3360 MOUSE_SHARED_EP = no SPLIT_KEYBOARD = yes -SRC += drivers/sensors/pmw3360.c -QUANTUM_LIB_SRC += spi_master.c tm_sync.c +QUANTUM_LIB_SRC += tm_sync.c DEFAULT_FOLDER = handwired/tractyl_manuform/5x6_right/teensy2pp -- cgit v1.2.3