Skip to content

Conversation

@jdiercks
Copy link

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

@zefhemel
Copy link
Collaborator

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

@jdiercks
Copy link
Author

jdiercks commented Nov 10, 2025

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

Copy link
Collaborator

@zefhemel zefhemel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)

@jdiercks
Copy link
Author

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
Copy link
Author

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 jdiercks requested a review from zefhemel November 16, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants