ohueter/autokbisw

Keyboard "MX Keys" is recognized as mouse

Closed this issue · 5 comments

I have two Logitech devices - a MX Master 3 (Mouse) and a MX Keys (Keyboard). For mouse events, I see the appropriate message of ignoring events from it when looking at the logs with autokbisw -v 2:

received event from keyboard MX Master 3-[1133-45091-Logitech-8650418194568778] - 661132639 - 4299630569
ignoring event as device is a mouse

But this also appears when I am typing in my MX Keys:

received event from keyboard MX Keys-[1133-45915-Logitech-58FD86B9CF3FE9CA] - 3158248515 - 4299633249
ignoring event as device is a mouse

Because of this, I currently can't use autokbisw to switch language inputs, because the external keyboard is not recognized and so will not trigger a language change.

Both devices are connected through Bluetooth on macOS Monterey 12.6.1

Hi René,

thank you for bringing this up and the debug logs. At it's core, this seems to be the same issue as #16 but from a different keyboard vendor. The relevant line of code is here:

let conformsToMouse = IOHIDDeviceConformsTo(senderDevice, UInt32(kHIDPage_GenericDesktop), UInt32(kHIDUsage_GD_Mouse))

I think autokbisw need a way to generically handle exceptions to this rule via some sort of configuration, but I don't really know what's the best way to do this.

You seem to be an experienced Swift dev (very much in contrast to myself), so I would be curious about your opinion, if you wouldn't mind.

ces92 commented

I have the same problem with my NK65 keyboard too.

received event from keyboard NK65-[35176-20043-Yiancar-Designs-0-34869248] - 34869248 - 4295130530
ignoring event as device is a mouse

In #24 and #25 we proposed a way to handle this kind of issues, would greatly appreciate any contribution!

jrel commented

Hello, I tried adding defaults for my MX keyboard, but it doesn't work.
After this, I build a v1.5 branch directly in my machine and mv binary to brew binary location.
Restart the service and work as intended!

Thanks!

Happy to hear you found a solution that works for you!