Get Browser Hotkey Settings Using JavaScript/HTML5?
Is there any way to use JavaScript (or HTML5 if necessary) to retrieve the browser's current settings on hotkeys? Notice that开发者_开发技巧 I am not trying to modify the settings, just trying to retrieve it.
Sadly, your best bet for this is to use browser sniffing, and compile a list of known hotkeys.
For example, using the jQuery Client plugin, something like:
var fullscreen = {
Windows: {
MSIE: 'Alt+F11',
Firefox: 'Alt+F11'
},
Mac: {
Firefox: 'Shift+Command+F'
}
};
if(fullscreen[$.client.os] && fullscreen[$.client.os][$.client.browser]) {
// render the label
}
Of course, this is a bit of a PITA.
精彩评论