开发者

What is the keycode for CTRL+[char]?

I ne开发者_如何学JAVAed to send CTRL+[char] code to a terminal using JavaScript. So it's not a question of capturing it - I can detect CTRL down and I can detect a character key pressed, and if it was just for something that needed done in JS I'd be all set. However, I need to send it, as one character code to a terminal and I can't find for the life of me what the code for CTRL+[char] would be.

In this specific case I need the code for CTRL+Backspace combination, but I thought I could find, in the sea of internet, a table that lists all those keycodes, including CTRL+C/V/P, CTRL+Enter, and so on. No such luck though (I guess I still need to work on my Google-fu).

Anyone know this?


There's no such keycode - the keycode is always a single ascii character, in your case [char]. Note: if you press ctrl+v, first an event with keycode=ctrl is sent, and then another one with v.

The thing you're looking for is shiftkeys (afaik).


There is only one keyCode sent at a time, which is why each key event has boolean ctrlKey, shiftKey, altKey properties.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜