use alt + shift + a as a hotkey in IE 7/8

本秂侑毒 提交于 2019-12-23 03:14:46

问题


I am trying to attach an keyup listener on document object. I wanna know when user presses alt + shift + a or alt + shift + w. Both work in Chrome and Firefox. In IE, alt + shift + w works, but alt + shift + a doesn't. I know IE has few hot keys reserved, but why is taking over alt + shift combination, too? Is there a way to prevent this or is it a flow in IE?

Demo: http://jsfiddle.net/HnD5E/

Thanks


回答1:


You can get around this behavior with a keydown event.

$(document).keydown(function (e) {
            if (e.keyCode == 65 && e.altKey) {
                 e.preventDefault();
            }
        }).keyup(...);

http://jsfiddle.net/HnD5E/4/



来源:https://stackoverflow.com/questions/7759605/use-alt-shift-a-as-a-hotkey-in-ie-7-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!