MCPcopy Create free account
hub / github.com/Lobos/react-ui / isKeypressCommand

Function isKeypressCommand

docs/lib/react.js:126–130  ·  view source on GitHub ↗

* Return whether a native keypress event is assumed to be a command. * This is required because Firefox fires `keypress` events for key commands * (cut, copy, select-all, etc.) even though no character is inserted.

(nativeEvent)

Source from the content-addressed store, hash-verified

124 * (cut, copy, select-all, etc.) even though no character is inserted.
125 */
126function isKeypressCommand(nativeEvent) {
127 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
128 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
129 !(nativeEvent.ctrlKey && nativeEvent.altKey);
130}
131
132/**
133 * Translate native top level events into event types.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…