There is a virtual keyboard https://codepen.io/CitizenOne/pen/rReYqj

I press 10 keys on the physical keyboard, but for some reason only 3 clicks are displayed all the time on the virtual keyboard (sometimes it reaches 5). What's the matter? In my current project, it is simply crucial to track up to 10 clicks at a time.

UPD:

Wrote another script https://codepen.io/CitizenOne/pen/moPXbP

Array.prototype.remove = function() { var what, a = arguments, L = a.length, ax; while (L && this.length) { what = a[--L]; while ((ax = this.indexOf(what)) !== -1) { this.splice(ax, 1); } } return this; }; var keys_pressed = []; var pre = document.querySelector("pre"); document.onkeydown = function(e){ keys_pressed.remove(e.keyCode); keys_pressed.push(e.keyCode); pre.textContent = ""; var str = ""; for(var i = 0; i < keys_pressed.length; i++){ str = str + keys_pressed[i] + "\n"; } pre.textContent = str; } document.onkeyup = function(e){ keys_pressed.remove(e.keyCode); } 

In it I tried to store keystrokes in an array, but again I can’t catch more than 3-5 keystrokes. A nightmare of some kind.

Many thanks in advance to everyone who will help!

  • 99.999% is an iron limit. There are gaming keyboards without such a restriction, but they stand like a wing from an airplane. - Alexey Ten

0