Reputation: 1435
I have a beginner's question on JavaScript: In a small testing script I oberserved that some key-events seemingly do not trigger when others are already triggered. In other words: If some keys are down, most of the other keydown-events are kind of blocked. For example holding down keys a, s, d, f, g do not trigger the keydown-event for g. However, If I am holding e.g. h and j down, too, their keydown-event is triggered as expected.
For this test I've used Mozilla Firefox 26.0 on Windows 7 Home Edition 64-Bit.
Here is the included JavaScript file which is used to output the map of key-events with keydown-type to some div-element with id "testout001"
:
var keyMap = [];
function keyMapToHTML(arr){
var i = 0;
var temp = "";
while(i<arr.length){
if(arr[i]){
temp += i + "<br>";
}
i++;
}
return temp;
}
function keyHandler(e){
e = e || event; // deal with IE
keyMap[e.keyCode] = (e.type == 'keydown');
document.getElementById("testout001").innerHTML = keyMapToHTML(keyMap);
}
Thank you in advance for your suggestions!
Upvotes: 0
Views: 207
Reputation: 121
It's a common hardware issue with most keyboards. Certain keypresses just cannot be detected at the same time.
Upvotes: 1