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

Support of ZMK's official mouse functionality #11

Open
OopsYao opened this issue Jan 16, 2025 · 5 comments
Open

Support of ZMK's official mouse functionality #11

OopsYao opened this issue Jan 16, 2025 · 5 comments

Comments

@OopsYao
Copy link

OopsYao commented Jan 16, 2025

Hi, thanks for your awesome project at first! The mouse functionality has been officially merged (zmkfirmware/zmk#2477) into ZMK main branch, and it seems that this driver does not support it yet --- when compiling using zmk main, it yells at no file zmk/mouse/types.h.

FAILED: CMakeFiles/app.dir/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/mouse/input_listener_ps2.c.obj 
/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DNRF52840_XXAA -DPICOLIBC_INTEGER_PRINTF_SCANF -D_FORTIFY_SOURCE=1 -D_POSIX_C_SOURCE=200809 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/xyzzz/Projects/zmk/app/include -I/home/xyzzz/Projects/zmk/zephyr/include -I/home/xyzzz/Projects/zmk/app/build/right/zephyr/include/generated -I/home/xyzzz/Projects/zmk/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/xyzzz/Projects/zmk/zephyr/soc/arm/nordic_nrf/common/. -I/home/xyzzz/Projects/zmk/zephyr/subsys/usb/device -I/home/xyzzz/Projects/zmk/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I/home/xyzzz/Projects/zmk/zephyr/subsys/bluetooth -I/home/xyzzz/Projects/zmk/zephyr/subsys/settings/include -I/home/xyzzz/Projects/zmk/modules/hal/cmsis/CMSIS/Core/Include -I/home/xyzzz/Projects/zmk/zephyr/modules/cmsis/. -I/home/xyzzz/Projects/zmk/modules/hal/nordic/nrfx -I/home/xyzzz/Projects/zmk/modules/hal/nordic/nrfx/drivers/include -I/home/xyzzz/Projects/zmk/modules/hal/nordic/nrfx/mdk -I/home/xyzzz/Projects/zmk/zephyr/modules/hal_nordic/nrfx/. -I/home/xyzzz/Projects/zmk/modules/crypto/tinycrypt/lib/include -I/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/include -I/home/xyzzz/Projects/zmk/app/module/include -I/home/xyzzz/Projects/zmk/app/module/drivers/sensor/battery/. -fno-strict-aliasing -Os -imacros /home/xyzzz/Projects/zmk/app/build/right/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mfp16-format=ieee --sysroot=/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/xyzzz/Projects/zmk/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/xyzzz/Projects/zmk/app=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/xyzzz/Projects/zmk/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/xyzzz/Projects/zmk=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -Wfatal-errors -MD -MT CMakeFiles/app.dir/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/mouse/input_listener_ps2.c.obj -MF CMakeFiles/app.dir/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/mouse/input_listener_ps2.c.obj.d -o CMakeFiles/app.dir/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/mouse/input_listener_ps2.c.obj -c /home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/mouse/input_listener_ps2.c
/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/mouse/input_listener_ps2.c:20:10: fatal error: zmk/mouse/types.h: No such file or directory
   20 | #include <zmk/mouse/types.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
[17/341] Building C object CMakeFiles/app.dir/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/src/drivers/input/input_mouse_ps2.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/xyzzz/Projects/zmk/app/build/right

It would be great if you can add the support. Again, thanks for making this beautiful project, I really like it! 👍

@filippor
Copy link

to work with main you need to replace the "zmk,input-listener-ps2" from this module with the "zmk,input-listener" from main

@OopsYao
Copy link
Author

OopsYao commented Jan 17, 2025

Thanks for the help! But it does not work, unfortunately, giving errors:

devicetree error: 'layer-toggle' appears in /mouse_ps2_input_listener in /home/xyzzz/Projects/zmk/app/build/right/zephyr/zephyr.dts.pre, but is not declared in 'properties:' in /home/xyzzz/Projects/zmk/app/dts/bindings/zmk,input-listener.yaml
-- In: /home/xyzzz/Projects/zmk/app/build/right/zephyr, command: /home/xyzzz/Projects/zmk/.venv/bin/python;/home/xyzzz/Projects/zmk/zephyr/scripts/dts/gen_defines.py;--dts;/home/xyzzz/Projects/zmk/app/build/right/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;/home/xyzzz/Projects/kb_zmk_ps2_mouse_trackpoint_driver/dts/bindings;/home/xyzzz/Projects/zmk/app/module/dts/bindings;/home/xyzzz/Projects/zmk/app/dts/bindings;/home/xyzzz/Projects/zmk/zephyr/dts/bindings;--header-out;/home/xyzzz/Projects/zmk/app/build/right/zephyr/include/generated/devicetree_generated.h.new;--dts-out;/home/xyzzz/Projects/zmk/app/build/right/zephyr/zephyr.dts.new;--edt-pickle-out;/home/xyzzz/Projects/zmk/app/build/right/zephyr/edt.pickle;--vendor-prefixes;/home/xyzzz/Projects/zmk/app/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;/home/xyzzz/Projects/zmk/zephyr/dts/bindings/vendor-prefixes.txt
CMake Error at /home/xyzzz/Projects/zmk/zephyr/cmake/modules/dts.cmake:279 (message):
  gen_defines.py failed with return code: 1
Call Stack (most recent call first):
  /home/xyzzz/Projects/zmk/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  /home/xyzzz/Projects/zmk/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /home/xyzzz/Projects/zmk/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:9 (find_package)

Did I miss something?

@filippor
Copy link

For the input listener you Need to follow the instruction on main documentation remove the layer-toggle properties and of Need use the input processor
I have a working configuration here https://github.com/filippor/kb_zmk_ps2_mouse_trackpoint_driver-zmk_config

@OopsYao
Copy link
Author

OopsYao commented Jan 18, 2025

Aha, I see. Since I changed the node type to zmk,input-listener, the old properties defined by kim's fork would not apply anymore. Now it works! Thank you so much. 😃

But I still believe that there should be an update for this driver — the document at least 👀; also noticed some warnings during building.

@infused-kim
Copy link
Owner

Hey guys,

@filippor thank you so much for providing workaround instructions. I really appreciate it.

Regarding the update: I am planning on updating the code and this driver is not abandoned.

I just have a lot of work right now and don’t have the time to dedicate to this, but it is on my list of todos.

I need to finish some other personal priorities in my free time first and then I will have time to update this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants