简体   繁体   中英

Correct keyboard shortcut for a web application

I am documenting the keyboard shortcuts for our web application. Please share if these are not the right keys to use, for any reason, such as interference with browser's own keyboard shortcuts/ OS shortcuts or general usability's sake.

The shortcut initiator will be SPACE , similar to how some Gmail shortcuts use '*' as initiator. The list of shortcuts is rather big, but here are a few of the key ones:

Functionality - shortcut

  • SAVE - SPACE + S
  • Undo - SPACE + Z
  • Redo - SPACE + Y

Our web application is a one page, without scroll, JavaScript application. We are considering John Resig's Hotkeys , Mousetrap , and jKey for the plugin. Any thoughts, warnings would be much appreciated on the use of the above keyboard shortcuts.

Hotkeys is a robust JavaScript library for capturing keyboard input and key combinations entered. It has no dependencies.

hotkeys('escape+a,escape+b,escape+z', function(event,handler){
    switch(handler.key){
        case "escape+s":alert('you pressed escape+s!');break;
        case "escape+z":alert('you pressed escape+z!');break;
        case "escape+y":alert('you pressed escape+y!');break;
    }
});

Hotkeys understands the modifiers , shift , option , , alt , ctrl , control , command , and .

The following special keys can be used for shortcuts: backspace , tab , clear , enter , return , esc , escape , space , up , down , left , right , home , end , pageup , pagedown , del , delete and f1 through f19 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM