Skip to content

Swing range: a more expressive tap - #24

Open
tumaranja wants to merge 2 commits into
nilbuild:mainfrom
tumaranja:swing-range
Open

tumaranja wants to merge 2 commits into
nilbuild:mainfrom
tumaranja:swing-range

Conversation

@tumaranja

Copy link
Copy Markdown

Hi Kamran, I love TinyHand 😄 Was going to buy the physical pointer hand, but a friend sent me a link and this is so much better!

To make the interaction a bit more satisfying, how about making the stick move more expressively on tap? 😃 Similar to how it moves in physical space. I'd like to suggest to add it to the original app.

This PR adds a slider where users can determine the range of motion on tap, from how it is now to moving quite expressively.

Top row: Before, the original tap only shrinks the hand a little. Bottom row: After, with the Swing range slider at 0 (same as before), 1× and 2×; the higher the setting, the further the stick swings up and down.

What changes

  • Swing up (0.13 s): the fingertip lifts about 20% of the screen height at the default swing range (and a little to the right). The hand holding the stick rises about half as far with it, so the whole stick moves, not just the tip.
  • Swing down (0.09 s): it swings down onto the spot and presses, then settles back. There's no wobble or overshoot.
  • Sound: the tap sound waits until the fingertip lands (ArmView.strikeDelay, 0.22 s). The laser style is unchanged and still plays at once.
  • Drawing: a drag skips straight to the pressed pose, so ink starts where you clicked.
  • Swing range: a new button in the bottom toolbar opens a slider from Off to 2× (default 1×) that scales how far the stick swings. Off is exactly today's tap: no swing, the same small shrink, the sound at once. It's saved with the other preferences and cleared by Reset. The slider is drawn to match the toolbar: a thin white rail on the dark glass and a white knob, with the value next to it.
  • Between taps: the hand moves exactly as before.

All of it lives in ArmView.swing(at:) in Sources/TinyHand/ArmView.swift, plus a small change in OverlayController to delay the sound, the swingRange preference, and the slider tray in Toolbar. RenderTest skips the swing so snapshots stay the same.

Testing

Built with swift build on macOS and tried on a MacBook Pro screen:

  • Single taps, fast repeated taps, tap and hold, drag to draw
  • Swing range slider at Off (same as the original tap), 1× and 2×
  • Other hand styles, and the laser (unchanged)
  • ⌥-click still switches to the regular cursor and clicks through

The timings and distances were tuned in a small browser prototype that mirrors the Swift code. You can try it in your browser; I left it out of this PR.

Happy to change the amounts, or make Off the default if you'd rather keep today's tap unless people turn it up.

Look forward to hearing your thoughts. You can also message me at hi@anja.design or on LinkedIn. Thanks for making TinyHand!

tumaranja and others added 2 commits November 10, 2026 17:33
On a tap the stick swings up and back down onto the spot, the holding
hand rising with it, and the tap sound plays when the fingertip lands.
A new Swing range button in the toolbar opens a slider from Off to 2x
(default 1x); Off keeps today's tap exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@riconeitzel

Copy link
Copy Markdown

Do I get this right: the more you tap the finger onto the screen the higher is the swing to mimic aggressiveness? 😄

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