react-hotkeys
Version:
A declarative library for handling hotkeys and focus within a React application
13 lines (9 loc) • 358 B
JavaScript
import describeKeyEventType from './describeKeyEventType';
function describeKeyEvent(event, keyName, keyEventType) {
var eventDescription = "'".concat(keyName, "' ").concat(describeKeyEventType(keyEventType));
if (event.simulated) {
return "(simulated) ".concat(eventDescription);
}
return eventDescription;
}
export default describeKeyEvent;