I'd like to enable changing the font size by holding down the right mouse button and using the scroll-wheel. Emacs does however treat mouse buttons as keys, so this obviously cannot be achieved directly by a straight-forward (define-key ... (kbd ...) ...)
binding.
Since I also don't want to disable the standard actions performed by "click and release" of the right mouse button, I can't just bind something to <up/down-mouse-3>
. Instead, I'd like to bind a command to the scroll events <mouse-4>
and <mouse-5>
, that detects, whether the right mouse button is being held.
Is this possible?
Related questions point to the variable track-mouse
, but it doesn't seem, like that method can distinguish different mouse buttons.
<down-mouse>
, then set a variable that you can check. Something based onkey-chord.el
might also be useful, but that would probably require more work to figure out. An easier solution, might be to add something to the right-click context menu (like a minor mode that binds scrolling to resize).