MCPcopy Create free account
hub / github.com/microsoft/SandDance / isKeypressCommand

Function isKeypressCommand

docs/external/js/react-dom.development.js:8806–8809  ·  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

8804 */
8805
8806 function isKeypressCommand(nativeEvent) {
8807 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
8808 !(nativeEvent.ctrlKey && nativeEvent.altKey);
8809 }
8810 /**
8811 * Translate native top level events into event types.
8812 *

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected