jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
2.2k stars 112 forks source link

Bug: Kanata eats up mouse configuration on KDE #1235

Open TZProgrammer opened 2 weeks ago

TZProgrammer commented 2 weeks ago

Requirements

Describe the bug

On KDE's mouse system setting pane, the configurations for my mouse are not applied, but when I change the device to "kanata" and apply them there, the configuration is applied.

Going into more detail. I was trying to remove mouse acceleration from my device (Logitech G502). When toggling the option for that device, nothing happened. However, "kanata" shows up as a device in the dropdown menu as well. When toggling that option for device "kanata", my mouse properly worked.

I am still unsure if this is a bug in Kanata's side, KDE's side, or if I messed something up when configuring the Kanata daemon.

Relevant kanata config

No response

To Reproduce

  1. Use KDE 6.1
  2. Have Kanata's daemon running
  3. Try to change the configuration for your mouse, possibly something easy to test like toggling "invert scroll direction"
  4. If that does not work, but toggling it for the "kanata" device does, the bug has been reproduced.

Expected behavior

"kanata" should not show up as a device for kde. If this is intended, it should not eat other devices configurations.

Kanata version

1.6.1

Debug logs

No response

Operating system

Linux

Additional context

No response

jtroo commented 2 weeks ago

You likely need to exclude the Logitech mouse from Kanata's grabbed devices via defcfg. The auto detection likely senses it has keyboard keys.

TZProgrammer commented 1 week ago

This solution did in fact work, thank you!

I am still slightly concerned that this seems more like a hack than a solution though. Is it correct for kanata to show up in the mouse configuration settings in kde, or is this something unavoidable due to how kde / kanata are implemented?

jtroo commented 1 week ago

Kanata can output mouse actions if configured to do so, so Kanata does, correctly, present as a mouse to the desktop environment.

One thing that comes to mind that could be improved might be to make changes to Kanata's device auto-grabbing to avoid mouse devices that are seemingly presenting as keyboards, instead of mouse devices needing to be specified as excluded. But ultimately any heuristic for auto-grabbing might be faulty, so explicit specification via defcfg is the solution.