Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell if an event comes from right Ctrl key?

Tags:

javascript

I have an event listener in Javascript, I can tell whether a key event is Ctrl (e.keyCode == 17), but how can I know this Ctrl comes from the right one or left one?

like image 724
Thomson Avatar asked Jan 04 '11 05:01

Thomson


2 Answers

Just a quick note: I wouldn't base an architecture / design on the availability of the right control key - many laptop keyboards may not have two control keys.

like image 148
JustinByrne Avatar answered Oct 01 '22 13:10

JustinByrne


I don't think the keyCode is different.

You can use e.ctrlKey for a better way to determine if the control key was pressed.

It seems Flash can not tell which one is pressed either (either that or coded incorrectly).

like image 39
alex Avatar answered Oct 01 '22 13:10

alex