Safe JavaScript Keyboard Shortcuts

Having e.g. Alt+Z bound to certain functionality in your webapp helps users to control the app quickly. However, certain browsers may reserve certain key combinations (e.g. Ctrl+W to close a tab) and will not pass those combinations to your app.

There is no general consensus on which shortcuts are safe to use and which are not. Certain key combination might work on Firefox/Linux but not on Firefox/Mac or Firefox/Windows; the blocked key combinations might even change between browser versions.

There are bits and pointers:

I think generally the safest option is to follow shortcuts used by big players:

Jira uses a concept of modifier keys which differ based on browser + OS, so perhaps this is the best way?

Web Browser Mac OS X Windows UNIX/Linux
Firefox Ctrl Alt + Shift Alt + Shift
Internet Explorer Alt    
Safari Ctrl + Alt Ctrl  
Chrome Ctrl + Alt/Option Alt + Shift Alt + Shift


Written on December 18, 2020