在IE 7/8中使用alt + shift + a作为热键 [英] use alt + shift + a as a hotkey in IE 7/8

查看:109
本文介绍了在IE 7/8中使用alt + shift + a作为热键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在文档对象上附加一个keyup侦听器。我想知道用户何时按 alt + shift + a alt + shift + w 。两者都适用于Chrome和Firefox。在IE中, alt + shift + w 有效,但 alt + shift + a 没有。我知道IE保留的热键很少,但为什么还要接管 alt + shift 组合呢?有没有办法防止这种情况或者它是IE中的流程?

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?

演示:
http://jsfiddle.net/HnD5E/

谢谢

推荐答案

您可以使用 keydown 事件解决此问题。

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/

这篇关于在IE 7/8中使用alt + shift + a作为热键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆