Usage of mouse-button (scroll-wheel) in shortcuts (kwin, zoom)

hello world,

allow me to mention that i’m absolutely fascinated by this unbelievable beautiful and intelligent, wonderful OS, KDE!

quick question:

environment:
Ubuntu 24.10, KDE PLasma 6.1.5, KDE Frameworks 6.6.0 Qt Version 6.6.2, Wayland , Kernel 6.11.0-9-generic #9-Ubuntu

question:
i’d like to use the kwin (desktop effects) zoom function with my mousescroll / touchpad. to do so, i’d have to add “button 4” and “button 5” (checked with xev) to the meta button. something like this: “meta+button 4”

what did i try:
since i can’t add the mousescrollbutton, neither under desktop effekts itself, nor under settings shortcuts kwin, i tried to work with the: ~/.config/kglobalshortcutsrc file.

but, manipulating:

view_zoom_in=Meta++\tMeta+button 4,Meta++\tMeta+=,Zoom In
view_zoom_out=Meta+-\t,Meta+button 5,Zoom Out

didn’t generate additional happiness.

so, does anyone know if it is possible to use mousescrollwheel to zoom, and has a hint?

thank you so much for this beautifull piece of open source art!

best, me (-:

Hi there, if you are using a wayland session, there is already a keyboard shortcut for desktop zoom. Try using:

ctrl+meta+mousewheel

I hope I did not read the question wrong and this helps. :wink:

1 Like

wow, Jacomo, thank you very much - that is indeed a pretty interesting info!

one of the reasons, i tried to find a way to set this shortcut manually, was to be able to also set my additional mouse buttons to switch desktops. but this seems to be possible, by:

desktop → right-click → desktop & wallpaper → mouse actions.

and, amazing as KDE is, my Roccat mouse was flawlessly recognised under mouse options, with the posibility there to set shortcuts as well (-:

more details to your answer may be found here: Did you know you can Meta+Ctrl+Scroll to zoom on Wayland? – Adventures in Linux and KDE

and, to be fine to close this topic as resolved, although there seem to be no way to set mouse scrolling directly, there seem to be a way to utilize additional mouse buttons and the scroll wheel, by using xbindkeys:
https://www.cricalix.net/2023/02/13/mapping-kdes-zoom-to-a-mouse-wheel/

so, maybe that help’s other as well…

best, me (-:

1 Like