Skip to content

Commit

Permalink
fix(mouse): Fix up tests and make ZMK_MOUSE explicit.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Apr 10, 2024
1 parent 1974fe9 commit 0b1d513
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 55 deletions.
6 changes: 2 additions & 4 deletions app/Kconfig.behaviors
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ config ZMK_BEHAVIOR_KEY_TOGGLE
config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED
imply ZMK_MOUSE
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED && ZMK_MOUSE

config ZMK_BEHAVIOR_SOFT_OFF
bool
Expand All @@ -20,8 +19,7 @@ config ZMK_BEHAVIOR_SOFT_OFF
config ZMK_BEHAVIOR_INPUT_TWO_AXIS
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_INPUT_TWO_AXIS_ENABLED
imply ZMK_MOUSE
depends on DT_HAS_ZMK_BEHAVIOR_INPUT_TWO_AXIS_ENABLED && ZMK_MOUSE

config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool
Expand Down
4 changes: 0 additions & 4 deletions app/include/zmk/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
#define ZMK_HID_REPORT_ID_LEDS 0x01
#define ZMK_HID_REPORT_ID_CONSUMER 0x02

// Needed until Zephyr offers a 2 byte usage macro
#define HID_USAGE16(idx) \
HID_ITEM(HID_ITEM_TAG_USAGE, HID_ITEM_TYPE_LOCAL, 2), (idx & 0xFF), (idx >> 8 & 0xFF)

static const uint8_t zmk_hid_report_desc[] = {
HID_USAGE_PAGE(HID_USAGE_GEN_DESKTOP),
HID_USAGE(HID_USAGE_GD_KEYBOARD),
Expand Down
4 changes: 4 additions & 0 deletions app/include/zmk/mouse/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

#define ZMK_MOUSE_HID_REPORT_ID_MOUSE 0x01

// Needed until Zephyr offers a 2 byte usage macro
#define HID_USAGE16(idx) \
HID_ITEM(HID_ITEM_TAG_USAGE, HID_ITEM_TYPE_LOCAL, 2), (idx & 0xFF), (idx >> 8 & 0xFF)

static const uint8_t zmk_mouse_hid_report_desc[] = {
HID_USAGE_PAGE(HID_USAGE_GD),
HID_USAGE(HID_USAGE_GD_MOUSE),
Expand Down
6 changes: 6 additions & 0 deletions app/tests/mouse-keys/mkp/native_posix_64.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y
1 change: 0 additions & 1 deletion app/tests/mouse-keys/mkp/native_posix_64.keymap
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <behaviors.dtsi>
#include <behaviors/mouse_keys.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/kscan_mock.h>
#include <dt-bindings/zmk/mouse.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
movement_set: Mouse movement set to -1/0
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -2/-2
movement_set: Mouse movement set to -3/-3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -2/-2
movement_set: Mouse movement set to -3/-3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -3/-2
movement_set: Mouse movement set to -5/-3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -3/-3
movement_set: Mouse movement set to -5/-5
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to 0/-3
movement_set: Mouse movement set to 0/-5
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#include <behaviors.dtsi>
#include <behaviors/mouse_move.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/kscan_mock.h>
#include <dt-bindings/zmk/mouse.h>

&mmv_input_listener {
scale-multiplier = <5>;
scale-divisor = <3>;
};

/ {
keymap {
compatible = "zmk,keymap";
Expand All @@ -16,16 +20,6 @@
>;
};
};

input_configs {
compatible = "zmk,input-configs";

mmv {
device = <&mmv>;
scale-multiplier = <5>;
scale-divisor = <3>;
};
};
};


Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
movement_set: Mouse movement set to -1/0
movement_set: Mouse movement set to 1/0
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -2/-2
movement_set: Mouse movement set to 2/2
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -2/-2
movement_set: Mouse movement set to 2/2
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -3/-2
movement_set: Mouse movement set to 3/2
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -3/-3
movement_set: Mouse movement set to 3/3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to 0/-3
movement_set: Mouse movement set to 0/3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#include <behaviors.dtsi>
#include <behaviors/mouse_move.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/kscan_mock.h>
#include <dt-bindings/zmk/mouse.h>

&mmv_input_listener {
x-invert;
y-invert;
};

/ {
keymap {
compatible = "zmk,keymap";
Expand All @@ -16,16 +20,6 @@
>;
};
};

input_configs {
compatible = "zmk,input-configs";

mmv {
device = <&mmv>;
x-invert;
y-invert;
};
};
};


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
movement_set: Mouse movement set to -1/0
movement_set: Mouse movement set to 0/-1
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -2/-2
Expand All @@ -7,12 +7,12 @@ movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -2/-2
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -3/-2
movement_set: Mouse movement set to -2/-3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to -3/-3
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
movement_set: Mouse movement set to 0/-3
movement_set: Mouse movement set to -3/0
scroll_set: Mouse scroll set to 0/0
movement_set: Mouse movement set to 0/0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#include <behaviors.dtsi>
#include <behaviors/mouse_move.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/kscan_mock.h>
#include <dt-bindings/zmk/mouse.h>

&mmv_input_listener {
xy-swap;
};

/ {
keymap {
compatible = "zmk,keymap";
Expand All @@ -16,15 +19,6 @@
>;
};
};

input_configs {
compatible = "zmk,input-configs";

mmv {
device = <&mmv>;
xy-swap;
};
};
};


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y
6 changes: 6 additions & 0 deletions app/tests/mouse-keys/mouse-move/move_x/native_posix_64.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y
6 changes: 6 additions & 0 deletions app/tests/mouse-keys/mouse-move/move_y/native_posix_64.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_GPIO=n
CONFIG_ZMK_BLE=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_ZMK_LOG_LEVEL_DBG=y
CONFIG_ZMK_MOUSE=y

0 comments on commit 0b1d513

Please sign in to comment.