From fe7aa25ad82f5551f0a84bb98df8ccbac39a8f79 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 18 Sep 2023 16:36:39 +0200 Subject: input: make wheel events mappable Un-grabbed wheel events are now passed through the mouse binding matching logic, instead of being hardcoded to scrolling the terminal contents. They are mappable through the BTN_BACK and BTN_FORWARD buttons. Since they're not actually button *presses*, they never generate a click count other than 1. This limitation is documented, but not checked in the config. This means it's possible to create bindings like "BTN_BACK+3" (i.e. triple "click"). They will however never trigger. The old, hardcoded logic is now accessible through the new scrollback-up-mouse and scrollback-down-mouse mouse bindings. They (obiously) default to BTN_BACK and BTN_FORWARD, respectively. Example usage: keep the default of scrolling terminal contents with the wheel, when used without modifiers, but map Control+wheel to font zoom in/out: [mouse-bindings] font-increase=Control+BTN_FORWARD font-decrease=Control+BTN_BACK (this also keeps the default key bindings to zoom in/out; ctrl-+ and ctrl+-) Closes #1077 --- foot.ini | 2 ++ 1 file changed, 2 insertions(+) (limited to 'foot.ini') diff --git a/foot.ini b/foot.ini index 359b2cf7..262556e7 100644 --- a/foot.ini +++ b/foot.ini @@ -190,6 +190,8 @@ # \x03=Mod4+c # Map Super+c -> Ctrl+c [mouse-bindings] +# scrollback-up-mouse=BTN_BACK +# scrollback-down-mouse=BTN_FORWARD # selection-override-modifiers=Shift # primary-paste=BTN_MIDDLE # select-begin=BTN_LEFT -- cgit v1.3