silverbullet icon indicating copy to clipboard operation
silverbullet copied to clipboard

ui.touch.bindings

Open jdiercks opened this issue 2 months ago • 4 comments

Replace hard-coded 2/3-finger touch gestures with new config.set options to map multi-touches to any command (or disable).

jdiercks avatar Nov 10 '25 03:11 jdiercks

Oh this is cool. I'll have a look soon.

zefhemel avatar Nov 10 '25 18:11 zefhemel

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 }, 
})

jdiercks avatar Nov 10 '25 19:11 jdiercks

Overall really like this feature, but a few things: 1. Please run make fmt to format the code 2. Please run make check to 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.

jdiercks avatar Nov 13 '25 15:11 jdiercks

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.

jdiercks avatar Nov 16 '25 20:11 jdiercks