forked from kofal.net/zmk
feat(mouse): Add mouse move and scroll support (#2477)
* feat(mouse): Add mouse move and scroll support
* Use Zephyr input subsystem for all pointers.
* Input processors for modifying events, e.g. scaling, swapping
codes, temporary (mouse) layers, etc.
* Mouse move/scroll behaviors.
* Infrastructure in place for physical pointer input devices.
* feat: Add input split support.
* docs: Add initial pointer docs.
---------
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Alexander Krikun <krikun98@gmail.com>
Co-authored-by: Robert U <urob@users.noreply.github.com>
Co-authored-by: Shawn Meier <ftc@users.noreply.github.com>
Co-authored-by: Chris Andreae <chris@andreae.gen.nz>
Co-authored-by: Anant Thazhemadam <47104651+thazhemadam@users.noreply.github.com>
Co-authored-by: Erik Tollerud <erik.tollerud@gmail.com>
Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>
This commit is contained in:
10
app/dts/input/processors.dtsi
Normal file
10
app/dts/input/processors.dtsi
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <input/processors/scaler.dtsi>
|
||||
#include <input/processors/code_mapper.dtsi>
|
||||
#include <input/processors/transform.dtsi>
|
||||
#include <input/processors/temp_layer.dtsi>
|
||||
29
app/dts/input/processors/code_mapper.dtsi
Normal file
29
app/dts/input/processors/code_mapper.dtsi
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
|
||||
/ {
|
||||
/omit-if-no-ref/ zip_xy_swap_mapper: zip_xy_swap_mapper {
|
||||
compatible = "zmk,input-processor-code-mapper";
|
||||
#input-processor-cells = <0>;
|
||||
type = <INPUT_EV_REL>;
|
||||
map
|
||||
= <INPUT_REL_Y INPUT_REL_X>
|
||||
, <INPUT_REL_X INPUT_REL_Y>
|
||||
;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/ zip_xy_to_scroll_mapper: zip_xy_to_scroll_mapper {
|
||||
compatible = "zmk,input-processor-code-mapper";
|
||||
#input-processor-cells = <0>;
|
||||
type = <INPUT_EV_REL>;
|
||||
map
|
||||
= <INPUT_REL_Y INPUT_REL_WHEEL>
|
||||
, <INPUT_REL_X INPUT_REL_HWHEEL>
|
||||
;
|
||||
};
|
||||
};
|
||||
33
app/dts/input/processors/scaler.dtsi
Normal file
33
app/dts/input/processors/scaler.dtsi
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
|
||||
/ {
|
||||
/omit-if-no-ref/ zip_x_scaler: zip_x_scaler {
|
||||
compatible = "zmk,input-processor-scaler";
|
||||
#input-processor-cells = <2>;
|
||||
type = <INPUT_EV_REL>;
|
||||
codes = <INPUT_REL_X>;
|
||||
track-remainders;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/ zip_y_scaler: zip_y_scaler {
|
||||
compatible = "zmk,input-processor-scaler";
|
||||
#input-processor-cells = <2>;
|
||||
type = <INPUT_EV_REL>;
|
||||
codes = <INPUT_REL_Y>;
|
||||
track-remainders;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/ zip_xy_scaler: zip_xy_scaler {
|
||||
compatible = "zmk,input-processor-scaler";
|
||||
#input-processor-cells = <2>;
|
||||
type = <INPUT_EV_REL>;
|
||||
codes = <INPUT_REL_X INPUT_REL_Y>;
|
||||
track-remainders;
|
||||
};
|
||||
};
|
||||
14
app/dts/input/processors/temp_layer.dtsi
Normal file
14
app/dts/input/processors/temp_layer.dtsi
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
|
||||
/ {
|
||||
/omit-if-no-ref/ zip_temp_layer: zip_temp_layer {
|
||||
compatible = "zmk,input-processor-temp-layer";
|
||||
#input-processor-cells = <2>;
|
||||
};
|
||||
};
|
||||
25
app/dts/input/processors/transform.dtsi
Normal file
25
app/dts/input/processors/transform.dtsi
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
|
||||
/ {
|
||||
/omit-if-no-ref/ zip_xy_transform: zip_xy_transform {
|
||||
compatible = "zmk,input-processor-transform";
|
||||
#input-processor-cells = <1>;
|
||||
type = <INPUT_EV_REL>;
|
||||
y-codes = <INPUT_REL_Y>;
|
||||
x-codes = <INPUT_REL_X>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/ zip_scroll_transform: zip_scroll_transform {
|
||||
compatible = "zmk,input-processor-transform";
|
||||
#input-processor-cells = <1>;
|
||||
type = <INPUT_EV_REL>;
|
||||
y-codes = <INPUT_REL_WHEEL>;
|
||||
x-codes = <INPUT_REL_HWHEEL>;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user