urob / zmk-config

Personal ZMK firmware configuration for various boards (34-keys, Corneish Zen, Planck)
703 stars 342 forks source link

Question: How to use the mouse layer? #27

Closed jnpngshiii closed 10 months ago

jnpngshiii commented 10 months ago

First of all, thank you for the repository.

My question is as asked. I can't use the mouse layer on my MacBook with magic mouse. In other words, no keystrokes work.

I noticed that the official documentation of zmk says: only mouse clicks can be simulated now (although I can't even do that). Is there a step I'm overlooking, please?

Thanks!

urob commented 10 months ago

If you had previously connected your board, try to (1) disconnect, (2) clear Bluetooth profile on the keyboard, (3) forget keyboard on the Mac, (4) then repair. In my experience all four steps are needed for mouse keys / movement to work.

jnpngshiii commented 10 months ago

Thank you for your reply!

But I still have some problems here:

Firstly, I can only add a mouse click simulation, but not a mouse movement simulation.

Secondly, even if I only add the mouse click simulation, after repeating steps 1,2,3 and 4 several times, the added mouse click simulation still does not work. Specifically, when I am clicking, the behaviour is the same as &trans.

I am not very familiar with ZMK. I noticed that the mouse movement simulation is implemented using your ZMK fork. Is it possible that there are some bugs present?

Thanks in the end for the work you've done. Regardless, any problems in this issue should be my own responsibility to resolve. But if you're interested, I'd appreciate it and would be happy to help.

My mouse click emulation in base.keymap.

My mouse movement emulation base.keymap and its action output.

urob commented 10 months ago

Did you activate mouse in your .conf files? It didn't look like you do but I might have missed it.

FYI -- This is only needed with the original mouse PR. The newer API of the upcoming native mouse support will automatically detect whether there are any mouse behaviors in use and activate as needed.

(If you are currently using my zmk branch, then the main branch would be currently using the original PR api and the main-with-native-mouse branch is using the new api. See the readme files there for how to migrate).

jnpngshiii commented 10 months ago

Thanks a lot! Switching to the main-with-native-mouse branch makes it work.