MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / isCoarsePointerDevice

Function isCoarsePointerDevice

src/cm/lsp/diagnostics.ts:26–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24export const LSP_DIAGNOSTICS_EVENT = "acode:lsp-diagnostics-updated";
25
26function isCoarsePointerDevice(): boolean {
27 if (typeof window !== "undefined") {
28 try {
29 if (window.matchMedia?.("(pointer: coarse)").matches) {
30 return true;
31 }
32 } catch (_) {
33 // Ignore matchMedia failures and fall back to maxTouchPoints.
34 }
35 }
36
37 return (
38 typeof navigator !== "undefined" &&
39 Number(navigator.maxTouchPoints || 0) > 0
40 );
41}
42
43function emitDiagnosticsUpdated(): void {
44 if (

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected