Gestures & WebcamPremium

Hand Cursor

An interface you drive without touching it: your index fingertip moves a ring over real buttons, a pinch clicks them, an open hand sweeping across turns the carousel. Without a camera, a drawn hand shows the gestures and the mouse keeps its usual behaviour.

WebcamMediaPipeHand trackingTouch-free

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Gestures & Webcam has 11 effects, all premium. Explore the category →

3 usage examples

Take a queue number without touching the screen — reception kiosk of a medical testing lab — Hand Cursor example 1

① Take a queue number without touching the screen — reception kiosk of a medical testing lab

WhenThe patient raises a hand in front of the kiosk: the ring follows the index, lands on "Blood test", and a pinch confirms. The ticket on the right shows the number, the room and the wait straight away.
WhyA screen nobody touches stays clean between patients. The tiles are large, the magnet forgives a loose aim, and the page needs nothing special: it receives a click, just like from a mouse.
SettingsFull-frame scene, four <button> elements carrying their ticket number (data-num). The page listens to hcr:click and fills the ticket. pointer-events: none on the scene: a kiosk without a mouse, the demo hand plays on its own; for the capture the script only gives it a path (demo._plan: go to the first tile, pinch, go to the third, pinch).
Move to the next exploded view with greasy hands — workstation of a motorcycle repair shop — Hand Cursor example 2

② Move to the next exploded view with greasy hands — workstation of a motorcycle repair shop

WhenThe mechanic is replacing brake pads. Without wiping his hands, he sweeps an open hand in front of the screen: the carousel moves to the next view and the left column names the part.
WhyHere the effect aims at no button: only the broad gesture counts, no aiming needed. The carousel keeps its arrows for mouse and keyboard.
SettingsThe bundled carousel, five renamed cards, arrows marked data-hcr-swipe-left and data-hcr-swipe-right, counter data-hcr-pos="View {i} of {n}". A 352 × 268 px block inside a job sheet. The page listens to hcr:swipe to name the view. The demo hand's path is set for two left swipes per capture.
Pause the class without putting the dumbbells down — player of an at-home strength class — Hand Cursor example 3

③ Pause the class without putting the dumbbells down — player of an at-home strength class

WhenWith dumbbells in hand, pinching is out. The person holds a hand still over "Pause": after 0.8 s of near stillness an amber gauge has gone round the ring and the class stops. Same for "Resume".
WhyDwell clicking swaps a fine gesture for a short wait. Three big buttons under the video are enough; the exercise list next to it stays an ordinary page.
Settingsdata-hcr-dwell="800" on the scene (360 × 294 px), three player buttons. The page listens to hcr:click and toggles Pause / Resume. With no mouse (pointer-events: none), the demo hand stops twice on "Pause" per capture: the shipped code fills the gauge and clicks.

How it works

The other effects in this family draw something around the hand. This one acts on the page: it turns the hand into a pointer for the elements placed in its scene (buttons, links, fields, anything with a tabindex). The index fingertip places a glowing ring, smoothed by a One Euro filter that removes jitter at rest without lagging when the hand moves fast. Within 28 px of a button the ring is pulled towards it, and it snaps inside when only a few pixels away, so nobody has to aim to the pixel.

The pinch is the click. When the thumb tip meets the index tip (gap under 30% of the palm length, released above 42%), the code freezes the position, focuses the button under the ring and calls its click() method: your usual handlers receive a genuine event, once per pinch even if the fingers stay closed. A white ripple leaves the ring.

An open hand crossing more than 22% of the scene width in under 0.55 s is a swipe. Moving left, the code clicks the element marked data-hcr-swipe-left ("next" in the bundled carousel); moving right, data-hcr-swipe-right. Two swipes need 0.9 s between them. A fist releases everything. Optionally, dwell clicking: holding the ring still over a button fills an amber gauge, then clicks.

With the camera off, two cases. If the mouse moves over the scene, the drawn index sits on the cursor and hover and click are the browser's own. Otherwise a drawn hand runs through the gestures: it aims at a tile, pinches, sweeps the carousel, pinches "Book", closes into a fist. That hand goes through the same reading code as the camera: 21 hand points, interpreted the same way. The captures on this page show that hand, no camera involved.

Accessibility

  • Everything works without a gesture: the interface is made of real <button> elements, reached with Tab in HTML order (camera button, tiles, carousel arrows and cards, dwell toggle), activated with Enter or Space. Inside the carousel, the left and right arrow keys scroll through the artworks; focus stays where it is.
  • Dwell clicking: for people who cannot pinch, the "Dwell click" toggle (or data-hcr-dwell on the scene) replaces the pinch with a pause of the ring over the button. The toggle is a button with aria-pressed; one click per stop, the ring has to leave the button before it can trigger another.
  • Readable feedback: the "Last click" line and the carousel position are aria-live regions, so a screen reader announces what the hand just did. Canvas and video are hidden from assistive technology.
  • Reduced motion: the drawn hand stays at rest with no choreography, the click ripple goes away and the carousel changes card without sliding. State feedback stays: highlight on the targeted button, dwell gauge.
  • Touch: a tap clicks the button under the finger, as on any page. Dragging horizontally moves the drawn hand; vertically, the page scrolls. Checked with touch emulation in all three engines.

Browser compatibility

Canvas 2D for the ring and the hand, everything else in HTML and CSS: 54 KB of JavaScript and 17 KB of CSS, unminified. Tried under WebKit 26.5, Firefox 151 and Chromium 149: with two copies on a page, a click in the second leaves the first alone; no request while the camera stays off; loop suspended off screen. With a simulated webcam (Chromium, Firefox), the first click downloads four files from two domains, and only one camera stays open at a time. A filmed hand (test video) was recognised open, pointing and as a fist; the pinch, both swipes and dwell clicking were confirmed by injecting hand positions. During detection, MediaPipe posts a usage record for Google to odml.pa.googleapis.com every minute (version number, time spent computing) that holds no image and no hand coordinate; your privacy policy should cover it. Safari: camera not verified.

Chrome 88+✓ Full (measured)
Firefox 89+✓ Full (measured)
Safari 15+✓ Demo measured · camera not verified
Edge 88+✓ Not verified
iOS Safari 15+✓ Not verified
Android Chrome 88+✓ Not verified

The minimum versions come from aspect-ratio, which shapes the scene. Camera refused, missing or already in use: a message in the status pill, and the interface stays usable with mouse, finger and keyboard. Detection module unreachable: same fallback. The camera button is never a hand target, so a pinch cannot switch off a kiosk's camera. The browser asks for permission on the first click of the camera button, and only if the page is served over https.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0852-root">
  <div class="hcr-scene" data-hcr-lang="en" role="region" aria-label="Hand Cursor — an interface driven by your hand in front of the camera: the index finger moves the cursor, a pinch clicks, an open hand swipes. Cursor demo, camera on request (processed on your device only)">
    <video class="hcr-video" playsinline muted autoplay aria-hidden="true" tabindex="-1"></video>
    <canvas class="hcr-canvas" aria-hidden="true"></canvas>
    <div class="hcr-bar">
      <button class="hcr-btn hcr-cam-btn" type="button" aria-pressed="false">
        <span class="hcr-btn-ico" aria-hidden="true"></span><span class="hcr-btn-txt">Turn camera on</span>
      </button>
      <p class="hcr-privacy">No image ever leaves your device.</p>
    </div>
    <p class="hcr-status" role="status" aria-live="polite"></p>
    <div class="hcr-scrim" aria-hidden="true"></div>
    <div class="hcr-ui">
      <div class="hcr-head">
        <p class="hcr-eyebrow">Museum · Home</p>
        <div class="hcr-label" aria-hidden="true">
          <span>Hand Cursor</span>
          <span class="hcr-hint">point · pinch to click · swipe to scroll</span>
        </div>
      </div>
      <div class="hcr-menu">
        <button class="hcr-tile" type="button">Visit</button>
        <button class="hcr-tile" type="button">Exhibitions</button>
        <button class="hcr-tile hcr-tile-primary" type="button">Book</button>
      </div>
      <div class="hcr-carousel" role="group" aria-roledescription="carousel" aria-label="Featured artworks">
        <button class="hcr-arrow hcr-arrow-prev" type="button" data-hcr-swipe-right aria-label="Previous artwork">‹</button>
        <div class="hcr-track">
          <button class="hcr-card" type="button"><span class="hcr-art" aria-hidden="true"></span><span class="hcr-cap">Dawn over the city</span></button>
          <button class="hcr-card" type="button"><span class="hcr-art" aria-hidden="true"></span><span class="hcr-cap">Blue skylight</span></button>
          <button class="hcr-card hcr-current" type="button"><span class="hcr-art" aria-hidden="true"></span><span class="hcr-cap">Ember No. 3</span></button>
          <button class="hcr-card" type="button"><span class="hcr-art" aria-hidden="true"></span><span class="hcr-cap">High tide</span></button>
          <button class="hcr-card" type="button"><span class="hcr-art" aria-hidden="true"></span><span class="hcr-cap">Prism</span></button>
        </div>
        <button class="hcr-arrow hcr-arrow-next" type="button" data-hcr-swipe-left aria-label="Next artwork">›</button>
        <p class="hcr-pos" aria-live="polite" data-hcr-pos="Artwork {i} of {n}"></p>
      </div>
      <div class="hcr-foot">
        <p class="hcr-log" aria-live="polite" data-hcr-log="Last click: {label} · {n}">Last click: —</p>
        <button class="hcr-chip" type="button" data-hcr-dwell-toggle="1000" aria-pressed="false" data-on="Dwell click: on" data-off="Dwell click: off">
          <span class="hcr-chip-ico" aria-hidden="true"></span><span class="hcr-btn-txt">Dwell click: off</span>
        </button>
      </div>
    </div>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Dwell clicking (HTML — data-hcr-dwell on the scene) off Stop time in milliseconds before the click, for example data-hcr-dwell="1000". The data-hcr-dwell-toggle button lets visitors switch it on themselves.
What the swipe does (HTML — data-hcr-swipe-left, data-hcr-swipe-right) carousel arrows Put these attributes on any button in the scene: a left swipe clicks the first, a right swipe the second.
Elements the hand ignores (HTML — data-hcr-no-target) the camera button A marked element stays clickable with mouse and keyboard, never with a pinch. Handy for a "Cancel order" button.
Pinch sensitivity (JS — PINCH_ON, PINCH_OFF) 0.30 and 0.42 Thumb-to-index gap relative to palm length. Lower PINCH_ON if clicks fire by themselves; keep a gap between the two values or the click will flicker.
Magnet (JS — MAGNET_MARGIN, MAGNET_PULL) 28 px, 0.6 Distance at which a button starts pulling the ring, and the strength of the pull (0 = none).
Swipe (JS — SWIPE_MIN, SWIPE_WINDOW, SWIPE_COOLDOWN) 22% of the width, 0.55 s, 0.9 s Distance to cover, time allowed to cover it, and minimum pause between two swipes.
Useful camera area (JS — ACTIVE_BOX) central 56% of the image Part of the image that maps onto the whole scene. The smaller it is, the further a small gesture moves the ring: handy on a big screen, less precise.
Texts (JS — TEXT, TEXT_EN; HTML — data-hcr-log, data-hcr-pos) French, English with data-hcr-lang="en" Camera messages, the "Last click" line and the carousel counter, with their {label}, {n}, {i} placeholders.

FAQ

Yes. The pinch calls focus() then click() on the targeted button: an addEventListener('click', …) or a plain link reacts as it would to a mouse. To know where a click came from, also listen to hcr:click on the scene: its detail gives the element and the method (pinch or dwell). Swipes fire hcr:swipe with their direction.
No, only what sits inside .hcr-scene: the code looks for targets there and nowhere else, so it never clicks a menu or a payment button elsewhere by surprise. For a full-screen kiosk, put the whole interface inside the scene, as in the first example.
The status pill says why (refused, no camera, camera busy, insecure page) and nothing else changes: the buttons are still buttons, usable with mouse, finger and keyboard. The effect adds a way to click; it does not replace the others.