开发者

Unable to capture Ctrl+Alt+Arrow key event in jQuery

开发者 https://www.devze.com 2023-01-11 04:27 出处:网络
For some strange reasons I can\'t capture Ctrl+Alt+Arrow key combination inside textarea. Is it some sor开发者_如何学编程t of system hotkey that is getting swallowed by Windows? Ctrl+Alt+Any Letter an

For some strange reasons I can't capture Ctrl+Alt+Arrow key combination inside textarea. Is it some sor开发者_如何学编程t of system hotkey that is getting swallowed by Windows? Ctrl+Alt+Any Letter and Ctrl+Alt+Shift+Arrow are getting captured fine.

$(document).ready(function() {
    $("textarea").bind("keydown", function(event) {
        console.log(event);
        if(event.altKey && event.ctrlKey && event.which == 38) {
            console.log("ctrl+alt+up"); //never triggered
        }
    });
});

When Ctrl+Alt+Any Letter is pressed I see all 3 events in console. When Ctrl+Alt+Arrow is pressed I see only 2 events (for Ctrl and Alt).

Any ideas?


I've just checked your code and everything works just fine in IE8, Firefox and Chrome. What browser are you using?

Have you tried using jquery hotkeys plugin ?

0

精彩评论

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