Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: pointer movement/scrolling #2027

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

petejohanson
Copy link
Contributor

@petejohanson petejohanson commented Nov 17, 2023

Continuation of the incremental integration of the great work from @krikun98 in #778 with the movement and scrolling pieces next. Based on the rebased work from @caksoylar and and the split acceleration from @bryanforbes

TODO

  • Docs update
  • Review acceleration curves/functions configurability
  • Review @manna-harbour Discord discussion on per-device scaling factors.
  • Review @manna-harbour Discord note on storing float values, and on send of the report discard whole values, but retain the fractional remainder to be included in the follow up calculations, to avoid jerkiness/jumpiness.

@petejohanson petejohanson added enhancement New feature or request pointers Pointer related functionality labels Nov 17, 2023
@petejohanson petejohanson self-assigned this Nov 17, 2023
k_work_submit_to_queue(zmk_mouse_work_q(), &mouse_tick);
}

K_TIMER_DEFINE(mouse_timer, mouse_timer_cb, mouse_clear_cb);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part that initially made me bang my head against the wall with all this is the fact that Zephyr sometimes seems to de-prioritize these timers if the system is under load.
This is (as far as I was able to understand) the primary cause of the instability with mouse movement - reports can be sent out at random intervals or dropped entirely.
I was exploring re-writing this system to use a dedicated thread, but I wasn't skilled enough at C at the time.
I'm not sure this basis for the tick system is robust enough for general use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... timers should be using the hardware timers to trigger, and happen in ISR context. The queue has a certain priority, can be preempted, etc. Tweaking that thread priority might help, but I'll play a bit to see what I can determine. Thanks for the insight!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is most certainly not definitive - it's a half-remembered conclusion from an investigation I wasn't skilled enough to perform two years ago, just food for thought. I distinctly remember reports being delayed or dropped and that causing instability. hog.c:335 might also be worth taking a look at.


/* Mouse move behavior */
#define MOVE_Y(vert) ((vert)&0xFFFF)
#define MOVE_Y_DECODE(encoded) (int16_t)((encoded)&0x0000FFFF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to move these decode defines outside the dt-bindings header, and to either plain mouse.h or the corresponding event headers they are used in.

@petejohanson petejohanson force-pushed the feat/pointers-move-scroll branch 9 times, most recently from 32ed133 to c2bf21b Compare November 25, 2023 00:46
englmaxi added a commit to englmaxi/zmk that referenced this pull request Nov 26, 2023
englmaxi added a commit to englmaxi/zmk that referenced this pull request Nov 26, 2023
@krikun98
Copy link
Contributor

krikun98 commented Dec 4, 2023

Could you please change the target to https://github.com/petejohanson/zmk/tree/core/zephyr-3.5-update here? The review is unnecessarily cluttered.

@petejohanson
Copy link
Contributor Author

Could you please change the target to https://github.com/petejohanson/zmk/tree/core/zephyr-3.5-update here? The review is unnecessarily cluttered.

Unfortunately, that will move the PR into a different GH fork, and make a bit of a mess. I recommend reviewing each commit for clarity for now, until the Zephyr 3.5 bits are merged into ZMK main.

@petejohanson petejohanson force-pushed the feat/pointers-move-scroll branch 5 times, most recently from 505343b to d837c95 Compare December 4, 2023 23:01
app/src/mouse/main.c Outdated Show resolved Hide resolved
Copy link
Contributor

@caksoylar caksoylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are some missed updates for the rebase to account for 36eda571b

app/src/behaviors/behavior_mouse_key_press.c Outdated Show resolved Hide resolved
app/src/behaviors/behavior_mouse_key_press.c Outdated Show resolved Hide resolved
app/src/behaviors/behavior_input_two_axis.c Outdated Show resolved Hide resolved
app/src/behaviors/behavior_input_two_axis.c Outdated Show resolved Hide resolved
* Remove now-unused mouse work queue and related mouse main file.
* Move ticks config into a DTS property on the two axis input behavior.
* Corrected logging for two-axis input timestamps.
* Buffer data from input devices and only surface to HID once synd'd.
* Always import mouse keys behavior and their associated listeners.
* Tweak listener code to only add listener nodes when
  listener and the associated input device are enabled.
@petejohanson petejohanson marked this pull request as ready for review April 10, 2024 05:27
@petejohanson petejohanson requested a review from a team as a code owner April 10, 2024 05:27
* Dedicated mouse source directory.
* Split mouse HID into dedicated USB endpoint and HoG service.
* Enable composite USB device automatically, tweak the
  various default sizes.
@proostas
Copy link

proostas commented May 13, 2024

Final update: it looks like this is caused by some Kernel bug in Ubuntu 22.04. In Ubuntu 21.04 and 24.04, mouse emulation works without any problems.

Presumably after this commit, all mouse buttons stopped working over BT but keep working fine over USB on my Ubuntu 22.04.1 machine. I tried clearing profiles and re-pairing a number of times, even flashed the reset firmware a couple of times, but to no avail. I even manually purged the cache (rm /var/lib/bluetooth/08\:BE\:AC\:1A\:BC\:FE/cache/C9\:07\:5B\:D7\:68\:4C), but it was empty (except for General/Name) anyway.

At the same time, on Macbook Pro, everything works perfectly. All mouse buttons (press, scroll, move) are available over BT.

Any ideas how to debug what went wrong on Ubuntu after that commit?

Edit: Just connected another keyboard with older firmware (which excludes that commit) to the same Ubuntu machine and mouse keys work fine over BT.

Edit2: Mouse buttons also stopped working on Android with the newer firmware and keep working with the older one.

The keyboard with a newer firmware (after the commit; non-working mouse buttons):

stas@neon:~$ bluetoothctl info C9:07:5B:D7:68:4C
Device C9:07:5B:D7:68:4C (random)
        Name: Ergonaut One
        Alias: Ergonaut One
        Appearance: 0x03c1
        Icon: input-keyboard
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        WakeAllowed: yes
        LegacyPairing: no
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
        UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
        Modalias: bluetooth:v1D50p615Ed0001
        RSSI: -58
        Battery Percentage: 0x5b (91)

dmesg on connect:

[61920.411528] input: Ergonaut One Keyboard as /devices/virtual/misc/uhid/0005:1D50:615E.001F/input/input50
[61920.411713] hid-generic 0005:1D50:615E.001F: input,hidraw1: BLUETOOTH HID v0.01 Keyboard [Ergonaut One] on 08:be:ac:1a:bc:fe

bluetoothd on pairing:

14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:16	neon	bluetoothd[109750]	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:17	neon	bluetoothd[109750]	src/device.c:load_gatt_db() No cache for C9:07:5B:D7:68:4C

btmon (Left Mouse Click):

> ACL Data RX: Handle 16 flags 0x02 dlen 16                                                                                                                                                           #2564 [hci1] 3053.537412
      ATT: Handle Value Notification (0x1b) len 11
        Handle: 0x002f
          Data: 010000000000000000
> ACL Data RX: Handle 16 flags 0x02 dlen 16                                                                                                                                                           #2565 [hci1] 3053.537415
      ATT: Handle Value Notification (0x1b) len 11
        Handle: 0x002f
          Data: 000000000000000000

The keyboard with an older firmware (before the commit; working mouse buttons):

stas@neon:~$ bluetoothctl info C2:65:AE:81:AC:51
 Device C2:65:AE:81:AC:51 (random)
        Name: Corne 3 WL BT
        Alias: Corne 3 WL BT
        Appearance: 0x03c1
        Icon: input-keyboard
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        WakeAllowed: yes
        LegacyPairing: no
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
        UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
        Modalias: bluetooth:v1D50p615Ed0001
        RSSI: -70
        Battery Percentage: 0x46 (70)

dmesg on connect:

[61811.030622] input: Corne 3 WL BT Keyboard as /devices/virtual/misc/uhid/0005:1D50:615E.001E/input/input48
[61811.030794] input: Corne 3 WL BT Mouse as /devices/virtual/misc/uhid/0005:1D50:615E.001E/input/input49
[61811.030963] hid-generic 0005:1D50:615E.001E: input,hidraw2: BLUETOOTH HID v0.01 Keyboard [Corne 3 WL BT] on 08:be:ac:1a:bc:fe

bluetoothd on pairing (also logs similar messages but much less):

14.05.2024 19:40	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:40	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/deviceinfo/deviceinfo.c:read_pnpid_cb() Error reading PNP_ID value: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
14.05.2024 19:41	bluetoothd	src/device.c:load_gatt_db() No cache for C2:65:AE:81:AC:51

btmon (Left Mouse Key Click):

> ACL Data RX: Handle 17 flags 0x02 dlen 16                                                                                                                                                           #2438 [hci1] 2939.557355
      ATT: Handle Value Notification (0x1b) len 11
        Handle: 0x002a
          Data: 010000000000000000
> ACL Data RX: Handle 17 flags 0x02 dlen 16                                                                                                                                                           #2439 [hci1] 2939.677405
      ATT: Handle Value Notification (0x1b) len 11
        Handle: 0x002a
          Data: 000000000000000000

Comment on lines +115 to +131
| `MOVE_UP` | Move up |
| `MOVE_DOWN` | Move down |
| `MOVE_LEFT` | Move left |
| `MOVE_RIGHT` | Move right |

### Examples

The following will send a scroll down event to the host when pressed/held:

```
&msc MOVE_DOWN
```

The following will send a scroll left event to the host when pressed/held:

```
&msc MOVE_LEFT
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what's actually meant, right? At any rate this seems to work where MOVE_* did not...

Suggested change
| `MOVE_UP` | Move up |
| `MOVE_DOWN` | Move down |
| `MOVE_LEFT` | Move left |
| `MOVE_RIGHT` | Move right |
### Examples
The following will send a scroll down event to the host when pressed/held:
```
&msc MOVE_DOWN
```
The following will send a scroll left event to the host when pressed/held:
```
&msc MOVE_LEFT
| `SCRL_UP` | Scroll up |
| `SCRL_DOWN` | Scroll down |
| `SCRL_LEFT` | Scroll left |
| `SCRL_RIGHT` | Scroll right |
### Examples
The following will send a scroll down event to the host when pressed/held:

&msc SCRL_DOWN


The following will send a scroll left event to the host when pressed/held:

&msc SCRL_LEFT

@ryanwwest
Copy link

Very excited by the recent work on this. I can barely wait for the day we can have a single ZMK primary 'dongle' talking to 3 zmk peripherals - split keyboard left, split keyboard right, and wireless trackball (e.g. variant of Ploopy Adept).

@myst729
Copy link

myst729 commented May 25, 2024

Mouse scroll keys work with key presses, but cannot be used by encoders. I defined several sensor behaviors like this:

  behaviors {
    volume_encoder: volume_encoder {
      compatible = "zmk,behavior-sensor-rotate";
      #sensor-binding-cells = <0>;
      bindings = <&kp C_VOL_UP>, <&kp C_VOL_DN>;
    };

    scroll_encoder: scroll_encoder {
      compatible = "zmk,behavior-sensor-rotate";
      #sensor-binding-cells = <0>;
      bindings = <&msc SCRL_UP>, <&msc SCRL_DOWN>;
    };

    rgb_encoder: rgb_encoder {
      compatible = "zmk,behavior-sensor-rotate";
      #sensor-binding-cells = <0>;
      bindings = <&rgb_ug RGB_BRI>, <&rgb_ug RGB_BRD>;
    };
  };

Both sensor-bindings = <&volume_encoder>; and sensor-bindings = <&rgb_encoder>; works, but sensor-bindings = <&scroll_encoder>; doesn't.

@caksoylar
Copy link
Contributor

Mouse scroll keys work with key presses, but cannot be used by encoders. I defined several sensor behaviors like this:

This is because the duration × move speed of the scroll behavior isn't enough for the OS to trigger a scroll. You need to either

  • bump tap-ms of the sensor-rotate behavior to a larger value, like 100, or
  • increase max speed of the scroll behavior (either via setting the ZMK_MOUSE_DEFAULT_SCRL_VAL define before importing the mouse header, or directly using &msc SCRL_Y(-50) etc.). The default speed is 10.

I'd probably try a combination of the two; e.g. try a tap-ms of 50 and see if scroll speed needs increasing.

@myst729
Copy link

myst729 commented May 25, 2024

I'd probably try a combination of the two; e.g. try a tap-ms of 50 and see if scroll speed needs increasing.

Adding tap-ms = <100>; does the trick. Thanks.

@fiplox
Copy link

fiplox commented Jun 13, 2024

I'd probably try a combination of the two; e.g. try a tap-ms of 50 and see if scroll speed needs increasing.

Adding tap-ms = <100>; does the trick. Thanks.

while adding tap-ms = <100>; makes it work, I find a delay being too big. Playing with parameters, found that tap-ms of 30 with #define ZMK_MOUSE_DEFAULT_SCRL_VAL 35 works almost perfect.

While using this branch I found out that if I use scroll with an encoder and I scroll too fast, the scroll is never released (infinite scroll) and I have to disconnect my keyboard.

molnarg added a commit to molnarg/Adv360-Pro-ZMK that referenced this pull request Jul 8, 2024
@eteq
Copy link

eteq commented Jul 14, 2024

Has @petejohanson abandoned this PR? Or is it awaiting review? (If abandoned I might try to pick it up in a follow-on PR but not if @petejohanson is still working on it)

@caksoylar
Copy link
Contributor

This isn't abandoned, I am guessing Studio work is getting more priority right now. Pete mentioned on Discord that he is planning to refactor the endpoints a bit (the current split one has some issues on some OS, like Ubuntu 22.04).

Meanwhile if anyone needs a rebased branch in the very near future, you can cherry-pick from https://github.com/caksoylar/zmk/commits/caksoylar/experimental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pointers Pointer related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet