zmk icon indicating copy to clipboard operation
zmk copied to clipboard

Factor out just the mouse key emulation from #778

Open DelusionalLogic opened this issue 2 years ago • 3 comments

This PR includes ONLY enough mouse emulation to enable mouse keys. It's a trimmed down version of #778.

I've left this as 2 commits, the first one is a squashed version of #778, the second removes everything that is not required for mouse keys.

It has been tested to work on a corne in usb mode. bindings on both the left and the right side work.

I would recommend squashing before merging, as having a commit that adds a bunch of stuff and then one that removes it again is sort odd, but it probably makes the review easier for people familiar with #778 already.

DelusionalLogic avatar Aug 17 '22 21:08 DelusionalLogic

I've been looking though the code, and I'm maybe not entirely convinced the mouse_button_state_changed_event does anything for me. It doesn't really seem to fit with the rest of ZMK to raise events on behaviors.

Does anyone have any opinions on that?

DelusionalLogic avatar Aug 22 '22 20:08 DelusionalLogic

I tried this and it doesn't work for me: Windows shows the mouse HID device not loading correctly when attached by USB and I get nothing when connected via BLE. I tested with a nice!nano. The mousepr does work for me.

codeandr3w avatar Sep 04 '22 16:09 codeandr3w

@codeandr3w That interesting. Do you get any error message or anything in the Windows EventLog? I'm running an expanded version of this PR on my crkbd and it's working in both windows and linux over USB with no issues.

DelusionalLogic avatar Sep 08 '22 17:09 DelusionalLogic

Also was unable to get this pr working on windows 11. nice!nano_v2 connected over USB. Haven't tried the original PR yet, that will be next.

Here's the details of the error from device manager:

Error: This device cannot start. (Code 10)

Driver: Microsoft HID-Compliant-Mouse 10.0.22000.653

Event: Device HID\VID_1D50&PID_615E&Col03\8&222c9c9c&1&0002 had a problem starting.

Driver Name: msmouse.inf Class Guid: {4d36e96f-e325-11ce-bfc1-08002be10318} Service: mouhid Lower Filters: Upper Filters: Problem: 0xA Problem Status: 0xC0110004

Update: the same keyboard works just fine on Ubuntu 18. Just has driver errors on Windows. Let me know if you need more data. I'm not super familiar with HID but I'm happy to help where I can.

aherriott avatar Oct 18 '22 05:10 aherriott

Firstly, Thanks for the review. I'm sorry it too so long to get back to this. I've asked some questions I think we should discuss before merging this, but I'll make the rest of the changes soon.

As for @aherriott. I'm not super familiar with how to debug this on windows, so I'll have to see if I can replicate. I daily a keyboard running this patch on windows without issue, but that keyboard also has additional unreleased changes. I'll try and revert to just this branch and see if i can replicate your issue.

If anyone has any idea of how to debug this, please do share. I'll happily fix it if I know what the issue is.

DelusionalLogic avatar Oct 29 '22 17:10 DelusionalLogic

So, one thing I'm noticing here, is that the HID report/descriptor here includes the buttons, but no X/Y axis report information. I'm wondering if perhaps this trips up Windows' HID driver which expects a collection in this usage page to include those.

The original lump sum PR had those items in the report descriptor, so perhaps worth adding that and seeing how the Windows testing goes.

petejohanson avatar Mar 27 '23 06:03 petejohanson

I've just opened #1991 as a starting point so folks can test the fixes for Windows there, and will be iterating on that to try to address all the review feedback and get this in. Please test there!

petejohanson avatar Nov 07 '23 00:11 petejohanson

Closing now that #1991 is merged.

petejohanson avatar Nov 24 '23 06:11 petejohanson