Skip to content

silasrm/shiftshortcuts.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

shiftshortcuts.js

Add support to shortcuts prefixed with Shift.

Why shift? Because control, alt/option and meta/windows/command keys is used by default operational systems shortcuts (Windows, OSX, Linux).

Shortcuts don't execute when input:text (and yours variants input:email and etc) or textarea remains focused.

Example: https://jsfiddle.net/silasrm/ju4mznpz/21/

##Initialize

shiftShortcuts(function(whichKey, elTarget, e) {
  // User press Shift + A
  if(whichKey == 'A') {
    executeActionA();
  }
});

function executeActionA() {
  alert('A action executed!');
}

##Stop library.

shiftShortcutsStop();

About

Add support to shortcuts prefixed with Shift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published