-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dynamic: Refactored for recent sensor changes in ZMK
- Loading branch information
Showing
11 changed files
with
83 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2022-2023 XiNGRZ | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#define DT_DRV_COMPAT zmk_behavior_mouse_wheel | ||
|
||
#include <zephyr/device.h> | ||
#include <drivers/behavior.h> | ||
|
||
#include <zephyr/logging/log.h> | ||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); | ||
|
||
#include <zmk/behavior.h> | ||
#include <app/hid_mouse.h> | ||
|
||
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) | ||
|
||
static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding, | ||
struct zmk_behavior_binding_event event) | ||
{ | ||
return hid_mouse_wheel_report(binding->param1, true); | ||
} | ||
|
||
static int on_keymap_binding_released(struct zmk_behavior_binding *binding, | ||
struct zmk_behavior_binding_event event) | ||
{ | ||
return hid_mouse_wheel_report(binding->param1, false); | ||
} | ||
|
||
static const struct behavior_driver_api behavior_mouse_wheel_driver_api = { | ||
.binding_pressed = on_keymap_binding_pressed, | ||
.binding_released = on_keymap_binding_released, | ||
}; | ||
|
||
static int behavior_mouse_wheel_init(const struct device *dev) | ||
{ | ||
ARG_UNUSED(dev); | ||
return 0; | ||
}; | ||
|
||
DEVICE_DT_INST_DEFINE(0, behavior_mouse_wheel_init, NULL, NULL, NULL, APPLICATION, | ||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mouse_wheel_driver_api); | ||
|
||
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2022-2023 XiNGRZ | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
/ { | ||
behaviors { | ||
/omit-if-no-ref/ mw: behavior_mouse_wheel { | ||
compatible = "zmk,behavior-mouse-wheel"; | ||
label = "MOUSE_WHEEL"; | ||
#binding-cells = <1>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) 2022-2023 XiNGRZ | ||
# SPDX-License-Identifier: MIT | ||
|
||
description: Mouse wheel behavior | ||
|
||
compatible: "zmk,behavior-mouse-wheel" | ||
|
||
include: one_param.yaml |
19 changes: 0 additions & 19 deletions
19
config/dts/bindings/behaviors/zmk,behavior-sensor-rotate-mouse-wheel.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters