Skip to content
filedom
Esc
↑↓navigate↵open⌘Jpreview
On this page

useDesktopRightClick

Calls a handler when a file is right-clicked.

import { useDesktopRightClick } from 'filedom';

useDesktopRightClick(path, () => flagCell());

The handler fires on a right-click, two-finger click or Control-click on the file at path. The gesture is consumed, so Finder’s context menu does not open.

Parameters

useDesktopRightClick(
  path: string | undefined,
  onRightClick?: (() => void)
)

path: filesystem path to watch. Undefined disables the subscription.

onRightClick: optional handler. Omit it to disable the subscription.

Returns

Nothing (void).

Was this page helpful?