开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜