How to use the mousetrap.unbind function in mousetrap

To help you get started, we’ve selected a few mousetrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oTranscribe / oTranscribe / src / js / app / ui.js View on Github external
export function addKeyboardShortcut(key, fn) {
    Mousetrap.unbind(key);
    Mousetrap.bind(key, function(e) {
        if (e.preventDefault) {
            e.preventDefault();
        } else {
            // internet explorer
            e.returnValue = false;
        }
        fn();
        return false;
    });
    
}
github baku89 / ui-study / src / js / gesture.ts View on Github external
dispose() {
		this.drag.dispose()
		Mousetrap.unbind('up', 'shift+up', 'down', 'shift+down', 'shift', 'option')
	}
github EmaSuriano / react-hotkey-tooltip / src / HotkeyWrapper.js View on Github external
componentWillUnmount() {
    const { disableTooltip, hotkey, tooltipHotkey } = this.props;

    if (!disableTooltip) {
      removeToolTipHelp(tooltipHotkey, this.setShowTooltip);
    }

    unbind(hotkey);
  }
github jotron / StudyMD / src / components / oneset / index.js View on Github external
componentWillUnmount() {
        Mousetrap.unbind('space', this.hide);
        Mousetrap.unbind('left', this.backward);
        Mousetrap.unbind('right', this.forward);
    }
    forward() {
github jotron / StudyMD / src / components / oneset / index.js View on Github external
componentWillUnmount() {
        Mousetrap.unbind('space', this.hide);
        Mousetrap.unbind('left', this.backward);
        Mousetrap.unbind('right', this.forward);
    }
    forward() {

mousetrap

Simple library for handling keyboard shortcuts

Apache-2.0
Latest version published 5 years ago

Package Health Score

69 / 100
Full package analysis

Popular mousetrap functions