Do USB or PS/2 keyboards respond faster?

34

10

Do USB or PS/2 keyboards respond faster in terms of end-to-end input latency, keystrike to character appearing on the screen?

Related:

Under either connection, is the time between keystrike to character appearing long enough to be perceptible?

Under either connection, is it possible to strike two keys in succession faster than the single-key input lag?

Aidan Ryan

Posted 2009-08-01T20:11:19.097

Reputation: 1 415

I doubt the difference is noticeable, but good question, I'd like to see the answers. +1 – Sasha Chedygov – 2009-08-01T20:18:03.230

Either way, humans cant type fast enough for it to make a difference. Use a stopwatch or stopwatch app and try to start and stop it in less than 1/10 a second and see how you do. – Keltari – 2013-10-11T03:08:48.310

I'd have thought that if you're going to measure from key stroke to character on screen, the overall performance of your operating system, particularly the video drivers, would have much more impact than the speed of the keyboard. – mauvedeity – 2011-09-29T14:16:37.837

You might have a point. But if you keep the same video drivers, the USB-vs-PS/2 keyboard difference might have an impact, and can be measured. – Torben Gundtofte-Bruun – 2011-09-29T15:26:54.290

Indeed it might, and I suppose that the gaming keyboard below would be worthwhile in that sense. But I can't really see how that kind of tiny difference would be significant most of the time. – mauvedeity – 2011-09-29T15:34:28.300

Answers

31

There was a study in 2002 that evaluated the response times of various keyboards so that those delays could be better accounted for in experiments where subjects' response times were being measured with keyboards.

There are a number of interesting results, but the point relevant to this question is that there was a fairly significant variance between keyboards, and all the USB keyboards tested had a longer effective scan interval (18.77 ms - 32.75 ms) than the PS/2 keyboards (2.83 ms - 10.88 ms).

To explain it simply, keyboards scan across each column of keys and check to see whether any are pressed. So your signal isn't generated the instant you press the key, but rather when the controller scans the key and sees that it is pressed. After the keyboard sends the PC the signal there are obviously additional delays before the character appears on your screen, but those are fixed regardless of the keyboard type.

So if you pressed a key the moment after it was scanned, it could take almost 30ms longer on a slow USB keyboard to be detected and sent to the computer. I'm sure there are some serious gamers who would claim to notice that kind of delay.

jtb

Posted 2009-08-01T20:11:19.097

Reputation: 2 115

5Very cool answer. But there is a catch: The author used DOS 6 as his operating system back then. I wonder whether the OS has some influence here or not. – innaM – 2009-08-01T21:20:44.517

9Yeah that's an important point, this is pretty old hardware running on DOS. And even in this controlled environment there's a lot of variance. From the article: "The reason for our using MS-DOS was to enable us to measure time accurately, which is more difficult in a multitask ing OS, such as Win dows, Linux, MacOS, or Unix. With a multitasking OS, it takes time for the computer resources to be switched from one task to an- other, and so there is no guarantee that the resources will be available exactly when needed." – jtb – 2009-08-01T21:29:43.307

1What is the answer to this as of 2019? Is PS2 still considered lower latency than USB 3.0? – Seiverence – 2019-01-14T15:13:18.077

1

@Seiverence I doubt it, at least not in any way that matters. This looks like a better article today: https://danluu.com/keyboard-latency/

– jtb – 2019-01-14T19:38:51.663

1@TorbenGundtofte-Bruun: We always look for an explanation of every perceived issue, whether the issue exists only our perception or in actual reality has no bearing on this fact of human nature. Most reseach I could find seem to indicate a minimum threshhold of human perception to be along the lines of 50ms or more, which is much, much higher than the difference in scanning delays between USB and PS-2 keyboards. You many indeed be a super-perceptor who is capable. But if I were you, I'd begin by changing easy things like key construction before trying to get a modern computer to support PS2. – music2myear – 2011-09-29T14:52:49.387

@music2myear there's a thing called n-key rollover that is a measure of how capable keyboards are at registering keypresses in quick succession (like "wer" in "were") - I've noticed a markedly poorer accuracy when using USB keyboards vs. PS/2 keyboards. Swapping to several other USB keyboards didn't help. Swapping to PS/2 did help - which seems to be in line with this answer. – Torben Gundtofte-Bruun – 2011-09-29T15:25:00.703

@TorbenGundtofte-Bruun: n-key rollover is a function of the keyboard controller, not of the frequency at which the controller polls the keys for presses. Your USB keyboard probably does not have n-key rollover, or if it does, it only supports a very low number of simultaneous presses. Higher-end USB keyboards support what is sometimes called "full n-key rollover" which, while using a USB connection, have the ability to handle the full complement of simultaneous keypresses without issue or misses. – music2myear – 2011-09-29T15:57:47.180

i don't get it. the longer scan time of the keys for a USB keyboard is due to the usb connection, or the keyboard hardware itself? i think your answer reads like it's the keyboard hardware's fault, which doesn't make sense. did i get it wrong? – JoséNunoFerreira – 2011-09-29T16:36:07.687

+1 Awesome answer. NOW I understand why my new USB keyboard is driving me nuts! – Torben Gundtofte-Bruun – 2009-10-09T07:11:11.613

10

I didn't see it mentioned anywhere on here, and although old, this post is still returned via a simple Google search -- so not only is the response time faster but PS/2 keyboards support unlimited roll-over, meaning you can press as many keys as you wish at once and they will all register. USB maxes out at 6, I believe. As a programmer, I don't often run into this issue, but for gamers, this means everything!

kmatheny

Posted 2009-08-01T20:11:19.097

Reputation: 201

4Worth noting that many gaming/professional USB keyboards today work around this limit by pretending (to the device they're plugged into) to be a USB hub with several "regular" keyboards plugged in. – Vladimir Panteleev – 2017-05-21T10:15:05.440

1While it is true that PS/2 keyboards do not have a max number of keys pressed, there are some combinations that will not register! On my ps/2 keyboard, I can simultaneously press the entire home row (A thru L) and all 9 keys will be detected correctly, but if I am holding down just J and K, presses of U go undetected. – sig_seg_v – 2018-04-10T00:40:43.097

2@sig_seg_v This is most likely a limitation of your particular keyboard and not the PS/2 interface per se. – tomasz86 – 2018-07-28T00:38:41.163

2

Any PC user with knowledge knows that PS/2 is a much better connection than USB. First,it will give you total freedom with no limit to the amount of simultaneous key presses. And, equally as important, using the PS/2 may just improve your overall gaming experience. The reason is that when you use a USB keyboard your computer is actually using CPU time polling your keyboard. The higher the polling rate the more CPU time is used to perform the polling. And because of the built-in debounce rate found on any quality keyboard, any polling rate above 200Hz is simply a waste of CPU time and really just a result of pointless marketing hype. Unlike USB keyboards a PS/2 keyboard isn’t polled at all. The keyboard simply sends a signal to the computer as key presses are made, which causes a hardware interrupt, forcing the CPU to register the signal.

alex

Posted 2009-08-01T20:11:19.097

Reputation: 37

2While it might be technically correct what you are saying, it would be nice to have some sources to link to. Also, the condescending tone doesn't help. – R-D – 2014-09-28T09:26:00.370

this is the crux of the issue -- USB keyboards use software interrupts, PS/2 keyboards use hardware interrupts. when building my PC, I made sure that the motherboard had PS/2 ports because I use it for realtime audio processing, and on a previous PC the software interrupts for the keyboard and mouse were directly competing with the USB sound card, sometimes actually causing buffer underruns when I would use the input! (the laptop's keyboard/touchpad used the USB bus for some reason). – sig_seg_v – 2016-02-12T03:47:56.567

0

Apparently, PS/2 is faster. If you buy a $150 keyboard like this one designed for professional gamers, the standard interface is PS/2. It has some super fancy, gold-plated, buffered PS/2 technology, although a USB-to-adapter is included.

petehern

Posted 2009-08-01T20:11:19.097

Reputation: 341

5Often enough golden connectors are more a sign of a good marketing, than a real benefit. – KingCrunch – 2014-10-15T12:51:16.840

2evidence? otherwise this is just conjecture – Keltari – 2013-10-11T03:05:50.643