How to create keyboard shortcuts for HTML5 apps? Using key events don't work because some browsers already define most of those inputs for built-in features such as Save As..., (which are useless for interactive apps).
How to create keyboard shortcuts for HTML5 apps? Using key events don't work because some browsers already define most of those inputs for built-in features such as Save As..., (which are useless for interactive apps).
Share Improve this question asked Mar 5, 2013 at 0:52 MaiaVictorMaiaVictor 53k47 gold badges157 silver badges301 bronze badges 1- 4 You have to show what you've tried, and what you don't like, there are plenty of shortcuts that aren't taken up by the browser... – Ruan Mendes Commented Mar 5, 2013 at 1:02
2 Answers
Reset to default 12Well, that one works for me: (CTRL-S in Chrome)
$(document).keydown(function(evt){
if (evt.keyCode==83 && (evt.ctrlKey)){
evt.preventDefault();
alert('worked');
}
});
try giving this a look.
http://www.openjs./scripts/events/keyboard_shortcuts/#add_docs
sample to add shortcut
shortcut.add("Ctrl+B",function() {
alert("Bold");});
sample to remove shortcut
shortcut.remove("Ctrl+B");