* 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)
| 177 | * (cut, copy, select-all, etc.) even though no character is inserted. |
| 178 | */ |
| 179 | function isKeypressCommand(nativeEvent) { |
| 180 | return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && |
| 181 | // ctrlKey && altKey is equivalent to AltGr, and is not a command. |
| 182 | !(nativeEvent.ctrlKey && nativeEvent.altKey); |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Translate native top level events into event types. |
no outgoing calls
no test coverage detected