ui.touch.bindings
Replace hard-coded 2/3-finger touch gestures with new config.set options to map multi-touches to any command (or disable).
Oh this is cool. I'll have a look soon.
A bonus feature that I forgot to document: 4/5-finger taps are also supported! Example:
config.set("ui.touch.bindings", {
-- disable the default 2-finger tap mapping, preserve browser pinch-zoom
{ fingers = 2, command = "", preventDefault = false },
-- add custom mappings for 3-5 fingers
{ fingers = 3, command = "Editor: Toggle Reader Mode", preventDefault = true },
{ fingers = 4, command = "Navigate: Page Picker", preventDefault = true },
{ fingers = 5, command = "Open Command Palette", preventDefault = true },
})
Overall really like this feature, but a few things: 1. Please run
make fmtto format the code 2. Please runmake checkto run the linters (they fail) 3. Have a look at my comments, some weird stuff in there (do I smell AI coding agents?)
Zef, you're absolutely right, I relied heavily on ChatGPT in putting this PR together. Your analysis reveals that I am even more ignorant than I thought about TypeScript, and you've exposed my relative inexperience at robust programming practices in general. All of your comments make sense, and I will work on tightening this up. Learning opportunity! :-)
Glad you like the concept; I'm definitely scratching my own itch here, but without the ability to unmap 2-finger tap, SB would be almost unusable for me on mobile, because I'm constantly pinch-zooming. Thanks.
All of your comments make sense, and I will work on tightening this up. Learning opportunity! :-)
Think I've addressed all the issues you raised, and ran make fmt/clean which passes now. See commit v1.3 just pushed.