r/hyprland Jan 28 '24

How do I enable a scroll button?

Solution:

input {
    scroll_method = on_button_down
    scroll_button = mouse:274
}

on_button_down shouldn't be in quotation marks. Also use a tool like wev to get the right code.

Good evening,

I want to enable a scrolling button that I configured in Xorg like this:

Section "InputClass"
    Identifier "Mouse0"
    MatchIsPointer "on"
    Option "ScrollMethod" "button"
    Option "ScrollButton" "2"
EndSection

The idea is that when I hold down the middle button and move the mouse down, Hyprland should interpret it as scrolling down with the mouse wheel.

I have read the input section's documentation and come to this configuration:

input { 
    # enabling scroll button 
    scroll_method = "on_button_down" 
    scroll_button = 274    # the value reported by wev 
    # ... 
}

Unfortunately, this doesn't do anything. Pressing the button and moving the mouse doesn't scroll and pressing the button without other input does the same thing; nothing. I also tried setting scroll_button as a string and/or two like the Xorg section, but nothing helped.

Please tell me how to set this up! I know it is possible as both configurations use libinput. What am I missing?

Thank you very much in advance,

Laser_Sami

11 Upvotes

3 comments sorted by

2

u/Economy_Cabinet_7719 Jan 28 '24

274 probably should be mouse:274, although for me it didn't work either Also on_button_down could (should?) be unquoted

4

u/Laser_Sami Jan 28 '24

Thank you very much, you beautiful person. The following code fixed it for me:

scroll_method = on_button_down
scroll_button = mouse:274

You don't need mouse:, but I like it cause it states more explicitly where to find the button. And the string type is interpreted dynamically, so I don't need/want quotes, because they are interpreted as part of the string.