@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

main
ts 8 lines 377 Bytes
Raw
1 import type { ContextMenuSource } from "@t3tools/contracts";
2
3 // Chromium uses no button for keyboard context menus and zero clicks for keyboard activation.
4 export function contextMenuSourceOf(
5 event: Pick<MouseEvent, "type" | "button" | "detail">,
6 ): ContextMenuSource {
7 return (event.type === "click" ? event.detail === 0 : event.button === -1) ? "keyboard" : "mouse";
8 }