https://bugs.kde.org/show_bug.cgi?id=476491

            Bug ID: 476491
           Summary: scrollOnButtonDown only works for buttons of the same
                    device.
    Classification: Plasma
           Product: kwin
           Version: 5.27.8
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: input
          Assignee: kwin-bugs-n...@kde.org
          Reporter: munzua...@gmail.com
  Target Milestone: ---

I hope this is the correct place to report this. If not, I'd appreciate it if
you could point me to the right direction.

scrollOnButtonDown only works for buttons of the same device. 
My scenario is this: I use input-remapper to remap buttons on my Elecom Huge
trackball. I currently do on-button scrolling by holding the middle click while
moving the trackball. I enabled it with these commands:

$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/event31
org.kde.KWin.InputDevice.scrollOnButtonDown true
$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/event31
org.kde.KWin.InputDevice.scrollButton 274 

274 corresponds to the middle click button code.
Instead of the middle click, I'd like to use another button. The problem is
that, in my case, mouse cursor movements belong to event31 but input-remapper
assigns remapped buttons to e.g. event28. I verify this by doing 

$ libinput debug-events

When I try to assign the scrollButton to one of the other buttons that I
remapped with input-remapper, it doesn't work. In this case, I try to do it
with a button that I remapped to right click (button code 273).

$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/event31
org.kde.KWin.InputDevice.scrollOnButtonDown true
$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/event28
org.kde.KWin.InputDevice.scrollOnButtonDown true
$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/event28
org.kde.KWin.InputDevice.scrollButton 273 

These commands have no effect and don't throw an error. Turns out that this
feature only works when the mouse cursor movements and the scrollButton come
from the same device. I tested it by plugging in another mouse and setting one
of its buttons as the scrollButton with commands like shown above. When I hold
that button on the second mouse while moving my trackball, it doesn't work. If
I move the cursor with my second mouse instead of my trackball, it works. In my
case, it works with the middle click because I haven't remapped it in
input-remapper so it belongs to the same device as the mouse cursor movements
(event31).

STEPS TO REPRODUCE
1. Plug in two mice, mouse A and mouse B 
2. $ libinput debug-events
3. Press the desired scrollButton on mouse A and move the cursor with mouse B
4. Note which eventXX those events belong to, as well as which button code
corresponds to the desired button
5. Enable scrollOnButtonDown on mouse B with

$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/<eventBB>
org.kde.KWin.InputDevice.scrollOnButtonDown true

6. Set the desired button on mouse A as the scrollButton with

$ qdbus org.kde.KWin /org/kde/KWin/InputDevice/<eventAA>
org.kde.KWin.InputDevice.scrollButton <button code>

OBSERVED RESULT
Holding down the desired scrollButton on mouse A and moving the cursor with
mouse B only moves the cursor and doesn't scroll.

EXPECTED RESULT
Holding down the desired scrollButton on mouse A and moving the cursor with
mouse B should scroll.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.5-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
I realize that my use case is very niche since I use a trackball and
input-remapper but I think enabling this feature to work on two separate
devices would be nice for other people as well who would like to e.g. hold down
the space button and move the cursor to scroll.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to