joshgoebel / keyszer

a smart, flexible keymapper for X11 (a fork/reboot of xkeysnail )
Other
69 stars 15 forks source link

Mouse is being grabbed as keyboard #123

Open laech opened 1 year ago

laech commented 1 year ago

Describe the bug or unexpected behavior I have a Logitech MX Master 3 mouse, and keyszer is grabbing that as a keyboard, as a result some mouse buttons no longer work.

Sample Config or Instructions to Reproduce

Happens on keyszer startup, not config specific.

Your setup

Expected behavior

Mouse to not be grabbed.

Additional context

The old xkeysnail didn't have this problem.

joshgoebel commented 1 year ago

I'd love some debugging and full list of keys the mouse says it supports... https://github.com/joshgoebel/keyszer/blob/main/src/keyszer/devices.py#L13

If it has QWERTY, A, Z, and Space I'm not sure how that's not really totally a keyboard?

Perhaps we just need a blocklist feature?

joshgoebel commented 1 year ago

as a result some mouse buttons no longer work.

Which ones?

laech commented 1 year ago

The backward and forward buttons don't work.

This is the full capabilities object for the mouse:

{
  0: [0, 1, 2, 4, 20],
  1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 119, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 240, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287],
  2: [0, 1, 6, 8, 11, 12],
  4: [4]
}
joshgoebel commented 1 year ago

So it's effectively a keyboard. :-). I'd be open to a skip_device config setting along the same lines as #19 if you were interested in working on a PR.

Or if you have another suggestion how we're supposed to not detect this as a keyboard when it's literally saying it has every single key a keyboard has?

laech commented 1 year ago

Seems this is how xkeysnail is detecting it's a mouse not a keyboard https://github.com/mooz/xkeysnail/blob/bf3c93b4fe6efd42893db4e6588e5ef1c4909cfb/xkeysnail/input.py#L28-L30

joshgoebel commented 1 year ago

That has it's own problems because some keyboards include a built in tracking device WITH pointers, which that improperly flags as a non-keyboard... that combo seems more likely than a mouse that reports having all the keys of a full keyboard, but truly has none.

I'm guessing it's some kind of fancy gaming mouse. I'll leave the issue open, but I don't consider this a bug - the suggested fix is we add a skip_device feature as suggested above so you could just block-list it in your config.