Slashdot Mirror


Ask Slashdot: Low-Latency PS2/USB Gaming Keyboards?

An anonymous reader writes "I've a cheap but low latency mouse (A4Tech) and I noticed my trusty old wired Logitech PS/2 keyboard seems at least 50ms slower (if not more) than the mouse when I test with those reaction time sites. I even increased finger travel distance over my mouse button to make it fairer and the difference still remains. So either the tests are slower with keyboards or my keyboard is high latency. Assuming the latter any suggestions for a good reasonably priced gaming keyboard? Extra function keys might be nice but since my hands aren't big what would be better is being able to output a custom key/combo if you hold down (special?) keys while pressing another key. For example I could configure it so if I hold down "Special Key 1" with pinkie or thumb and press 4 it actually outputs 9, and if I hold down shift as well it outputs shift+9 (and not just 9). Being able to replace the capslock key function and have it behave as another key (or a special modifier) would be a bonus — I've never needed capslock and have probably used it more by mistake than for its normal function, or to test how badly a PC has hung."

30 of 177 comments (clear)

  1. You're testing wrong by guruevi · · Score: 5, Interesting

    There is not a single modern keyboard that has 50ms latency. You (humans) have that sort of latency.

    As far as response times, all you need to do is increase the poll time on the USB stack, you should be able to set it to ~1-5ms, most keyboards are in the 5-10ms range. You can also get a custom keyboard which is used for psychophysics, they run about $300 and have a guaranteed sub-ms latency. But there must be some firmwares out there that can achieve the same for cheaper. I've tested Arduino Leonardo to about 1-2ms latency (also for psychophysics experiments).

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
    1. Re:You're testing wrong by bwoneill · · Score: 2

      Actually, PS/2 keyboards can't have a latency less than about 50 ms. The PS/2 specification requires a clock speed between 10 and 16.7 kHz which means that the signal must be in the up or down state for 30-50 ms. http://www.computer-engineering.org/ps2protocol/

    2. Re:You're testing wrong by Blaskowicz · · Score: 3, Informative

      You're off by a factor of one thousand. What you're quoting says :

      Data sent from the device to the host is read on the falling edge of the clock signal; data sent from the host to the device is read on the rising edge. The clock frequency must be in the range 10 - 16.7 kHz. This means clock must be high for 30 - 50 microseconds and low for 30 - 50 microseconds.. If you're designing a keyboard, mouse, or host emulator, you should modify/sample the Data line in the middle of each cell. I.e. 15 - 25 microseconds after the appropriate clock transition. Again, the keyboard/mouse always generates the clock signal, but the host always has ultimate control over communication.

    3. Re:You're testing wrong by AmiMoJo · · Score: 3, Interesting

      Every keyboard I have ever seen is a USB 1.1 HID device. The maximum polling rate is 10ms in the spec, although some might work at higher frequencies. In any case you are correct, the latency of pretty much any keyboard will be max 10ms. If the test sites say there is more then it isn't the keyboard, it is something in the OS or the browser or the operator.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    4. Re:You're testing wrong by mc6809e · · Score: 4, Informative

      There is not a single modern keyboard that has 50ms latency. You (humans) have that sort of latency.

      As far as response times, all you need to do is increase the poll time on the USB stack,

      Polling the USB stack has almost nothing to do keyboard response time.

      Keyboard response time depends mostly on how often the built-in microcontroller scans the keyboard matrix. A common interval is 40 ms. Polling the USB stack does nothing to get the microcontroller to scan the keyboard matrix more frequently. If the writer of the firmware decides 40 ms between scans is frequent enough, then you're stuck with 39+ ms latency in the worst case.

    5. Re:You're testing wrong by arielCo · · Score: 2

      I saw a TV program about that once; somehow the results of the experiment could be interpreted to cast doubt on what constitutes free will, but I can't find anything else about it. Do you know a few keywords I could use? A link would be superb.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    6. Re:You're testing wrong by mt42 · · Score: 3, Informative

      The paper that comes to my mind when I read your post is:

      Soon, C. S.; Brass, M.; Heinze, H.-J. & Haynes, J.-D. (2008). Unconscious determinants of free decisions in the human brain. Nature Neuroscience, 11, 5, 543-545, doi:10.1038/nn.2112 (article paywalled but a quick google provides an alternative link to the article PDF).

      I've a small collection of references for scientific "mind reading" studies I've gathered over the years, so if it's not the one you're thinking of, give me some more details and I might be able to dig it up for you.

    7. Re:You're testing wrong by AdamHaun · · Score: 2

      The real issue with USB keyboards is that if multiple keys are pressed within one polling interval, the order is ignored. For fast typists, this can easily result in swapped letters. It's quite annoying. Unfortunately, this behavior is part of the HID spec so there's not much that can be done now.

      To the submitter: I'm very sensitive to input lag, but I've never had noticeable lag from any PS2 keyboard. Right now I'm using a Dell AT101W, and before that I had some junky IBM membrane thing. Do you have any software installed for e.g. multimedia keys on the keyboard? That's the only thing I could see causing a problem unless the keyboard itself is just bad. Not sure I'd trust reaction time sites, though -- that's a pretty coarse measurement. If it's just for gaming, I wouldn't worry about the keyboard. The hand-eye coordination for the mouse is where you really need the tight feedback. It's a rare game that responds that quickly to the keyboard to begin with.

      If you're really dedicated to low-latency keypresses, I'd suggest a PS/2 keyboard using laptop-style scissor switches, if any exist. Another option would be Cherry MX Blue keyswitches, which activate closer to the top of the stroke. There's some hysteresis, though, so if you're jamming on the same key in a game it's easier to miss a stroke.

      I went crazy looking for a keyboard several years ago, and ended up a connoisseur. Definitely my most boring interest. :-)

      --
      Visit the
    8. Re:You're testing wrong by Anonymous Coward · · Score: 2, Insightful

      Every keyboard I have ever seen is a USB 1.1 HID device.

      You must either be very young or have not seen many keyboards.

    9. Re:You're testing wrong by Mr+Z · · Score: 2

      So, GGGP was less wrong than stated, but for the wrong reasons. Huzzah! That is a rather strange defense. "I thought I was supposed to go south, when actually I was supposed to go north. But, I misread the roadsign and got on a road that goes northeast, so I ended up not too far from my destination. See? I'm not a bad navigator!"

      Anyway, in the interest of actual analysis:

      Let's go at the low end: 10kHz. And let's pick a beefier keycode, say "R CTRL", that has a 2 byte scan code. No, we're not going to benchmark the hilarious pause key. Get real. The vast majority of the scan codes are 1 byte anyway.

      The time to send a key down event should be 2 bytes * 11 clocks, or 22 clock periods at 10kHz. That's 2.2 milliseconds. The time to send a key-up event should be 3 bytes * 11 clocks => 3.3 milliseconds.

      Both of those seem pretty fast. The OS itself, though, and whatever layers there are between the PS/2 connector and the OS, will add their own latency. But in a race between a PS/2 keyboard and a USB mouse? I think they're going to both be well under 50ms in any case. 50ms is 20Hz, which is "Intellivision games from the late 70s" speed.

    10. Re:You're testing wrong by Mr+Z · · Score: 2

      Yeah, I was going to say, 40ms seems a bit out there. If you consider a touch typist typing 100WPM, that's about 8.3 characters/second, or about 120ms / character. You may think 40ms is fast enough to accommodate that, but not really. Typing is bursty by nature, and so many of those consecutive keystrokes will come close together. If you scan too slowly, you might see two keys "become active" on the same scan, and end up reordering them. At 40ms, that seems entirely likely for a touch typist at 100WPM.

      10ms seems far more reasonable.

    11. Re:You're testing wrong by batkiwi · · Score: 2

      That's not QUITE how debouncing works, depending on the circumstances. Debouncing is more of a "sticky" state change than a delayed state change.

      If you're not pressing a key, and haven't been for a few mS, and then press it, the state change is registered instantly. Debounce then keeps you from "unpressing" the key until XYZ mS have passed to filter out stray switch glitches.

      As long as you're not trying to press a key on and off faster than the debounce time it's not actually slowing down your response time. That initial press, and letting go of a key you've held more than "X" mS, will always be "instant".

      So a debounce doesn't work like a capacitor, smoothing out the signal, it acts more like a triggered latching circuit.

  2. Re:so this...... by dyingtolive · · Score: 5, Insightful

    At least it's a nice change from the "do my job for me" Ask Slashdots.

    --
    Support the EFF and Creative Commons. The war is coming, and they're supporting you...
  3. Latency can have a number of reasons by aglider · · Score: 3, Interesting

    Mechanical-to-electronic interface is just one. The one you think it's to blame.
    Then you have the system interface (the USB and the PS/2).
    Then you have the full OS stack with its drivers, event listeners etc.
    Then you have the browser technologies (like Javascript stuff) which could react differently to different input classes.
    And finally the network latency.
    All of them at the same time.
    Maybe you are right in blaming the device, but I wouldn't bet a penny on it.

    --
    Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
  4. Key combo issues by TeknoHog · · Score: 2

    I find some old DOS games (emulated) unplayable because some key combinations won't register at all. For example, pressing one arrow key might not work, if another arrow key is already down. This seems to depend on both the keyboard and the motherboard though...

    --
    Escher was the first MC and Giger invented the HR department.
    1. Re:Key combo issues by pedrop357 · · Score: 2

      Sounds like called ghosting and is likely a problem with the keyboard itself or the way the emulator handles keystroke 'translation'.
      With the former, you'll see a lot of high end keyboards talk about being '100% ghosting free' or something similar to mean that every key press will be registered no matter how many keys are simultaneously held down.

      https://en.wikipedia.org/wiki/Rollover_(key)

  5. Re:Does ultra low-latency really matter? by Splab · · Score: 3, Interesting

    Normal human reaction time is in the 200ms to 300ms range, however, for specific stuff like gaming where we are reacting to known events, we can possibly react faster (sound for instance is keying us way before this, so we start reacting to the event).

    Now the 1 MS reaction time for gaming equipment is for precision, if your mouse doesn't stop moving the place where you wanted it to stop moving, it might be off by one or two pixels, which is a huge deal in gaming.

  6. Re:50 ms? by Miamicanes · · Score: 3, Insightful

    > The typical human reaction time is between 1/10th and 3/10th (more the later) of a second. That is 100 to 300ms.

    now pile another 50-100ms of USB latency on top, and you've just increased the problem by a non-insignificant factor.

    It's not a coincidence people gripe about USB. By traditional embedded-electronics standards, USB fsck'ing SUCKS. It's not a coincidence that there are STILL things you could bitbang with a real EPP/ECP parallel port that are flat-out impossible to do via USB. USB forces you to do your bitbanging at the remote end, and use the USB bus SOLELY for polled bit-shoveling after the fact. Serial ports required manual configuration up front, but once you got them configured... they pretty much worked flawlessly unless the wire had a short or a bad solder connection. Ditto for traditional parallel and ps/2 ports.

    I NEVER used to have ps/2 mice just stall and hang on me the way USB mice do under Windows. I've had plenty of times over the past few years when the ps/2 trackpoint on my keyboard worked fine, but the mouse pointer acted like it was frozen if I moved the USB mouse, for periods of 2-5 seconds a couple of times per week.

  7. Probably not, but some changes can matter by Sycraft-fu · · Score: 4, Insightful

    For certain kinds of games, where reaction time is pretty much the be all, end all (like Call of Duty) it does seem like it can make a difference. It isn't that your human reaction time isn't still the biggest thing, but that you make it faster relative to other people and thus gain an advantage. I was, and still am to a degree, skeptical that it matter much but I've tried it and seen results.

    So in my case, it was my monitor. I have long used professional screens, at the time it was a NEC 2690WUXi. Nice pro quality IPS screen, fully calibrated for a great image. It runs at 60fps, meaning 16.7ms between images and has about 33.3ms (2 frames) of delay for its image processing time. So basically 50ms from the time the computer sends the data to it, to the beginning of image formation. A few more ms for the image to fully form.

    I decided I wanted to see what the 120Hz hype was about, so I bought myself a second monitor, a BenQ XL2420T. It's a cheap TN panel, but very, very fast and has a mode to cut through all processing and lower latency. In 120fps mode you get a frame every 8.3ms, and delay of about 3.4ms until the image start forming, just another 1.5ms until it is complete. So 11.7ms from data to beginning of image formation.

    Well I found out two things. One is that you definitely CAN see the difference between 60 and 120 fps. It is actually more noticeable on the desktop, where you have sharp lines and high contrast, but in games too. It is a level of smoothness and fluidity you hadn't seen before.

    The other thing is that my performance in Black Ops 2 was quite measurably better playing on the faster monitor. My KDR (kill death ratio, how many times on average you kill another player per time you die) increased by over 0.5, which is a lot. It was just much easier for me to get shots off on people before they could get me.

    Now is that all latency? Probably not, the smoother frame rate probably helps too, but it is a difference that is really there. It isn't a case of "Oh you just want you new monitor to be better," or something I have both kinds of monitors and the pro one is what I use 99.9% of the time and for almost all games (I now have a PA301W) because the better colour and image quality is just so worth it. But there is no question for speed sensitive games, the faster display helps me do better.

    So how does this apply to mouse and keyboard? I've no idea. I haven't tested it. The keyboard I use is based off of ergonomics, not speed (a Kinesis Freestyle 2, they rock). However perhaps such a thing could help too.

    I mean the theory would go like this: Presume you have two people, both with an equal reaction time. Say 500ms if you like. Their computers process and prepare everything for display at the same time. However one guy has a fast screen, and the other a slow screen, like 10ms vs 50ms. Then also one guy has a fast input device, the other guy a slow one, say 1ms vs 10ms. What this means is that the net reaction time, as in the time from the computer saying "This has happened," to the time it receives a response, is 511ms in one case, and 560ms in the other. If you are talking games where a lot of damage is done per shot, that could be enough to make a difference.

    I'm not sure that it is worth worry about as much as people do, but I can see how it can make a difference in theory and I was amazed that the fast monitor made as much difference for me as it did. In general though, my recommendation is just stick to games that aren't so twitch based, and use a nicer display.

  8. Re:50 ms? by Anonymous Coward · · Score: 2, Funny

    I did some testing in that regard and the most important thing which can completely ruin gaming experience is latency caused by cable length. I would recommend to cut the the length to two feet maximum, replacement by the oxygen-free copper cables is highly desired as it is well known that cheap cables slow down the transport speed of the electrons (any professional audiophile will confirm that). If you are using wireless keyboard, please close all windows as any airflow/drags can cause variations in the response times.

  9. Cherry MX Brown by PopeRatzo · · Score: 2

    Forget about latency. It's not that big an issue with decent keyboards.

    Just get yourself a decent mechanical keyboard with the Cherry MX Brown switches. The Cherry Blue are good for typists, but not for gamers. The Browns are just right for keyboard gaming. Coolermaster makes about the least expensive one that is well-made. About $80 at newegg. Mine is a Ducky, but it was too expensive. The Coolermaster is every bit as good, and $60 cheaper.

    --
    You are welcome on my lawn.
    1. Re:Cherry MX Brown by willy_me · · Score: 4, Informative

      Brown is not what you want. They are similar to the "blue" keys but with less noise - I actually own both. There is still a significant distance the key must travel (up then down) to register sequential keystrokes. What you really want are the "red" keys. These keys require only a minimal amount of travel and do not have a noticeable "click" when activated. A pain for typists but it allows gamers to press keys at a very high frequency. The "black" keys are similar but require ~50% more force so they're a bit slower.

      But all mechanical keyboards are great at minimizing latency - it is because of the differences between switches and capacitors. The chiclet keyboards work my altering observed capacitance - this requires a controller to continuously scan for key changes and then send the appropriate signals to the host. This takes time and results in the latency the original poster was talking about. Mechanical keyboards are simple switches and are faster to scan. I imagine some mechanical keyboards are even interrupt driven resulting in latency measured in microseconds -- but changes in capacitance can't trigger interrupts.

    2. Re:Cherry MX Brown by Bensam123 · · Score: 2

      I disagree, being a pretty hardcore gamer and having used both reds and browns. You need that tactile feedback in order to understand exactly where you can pivot the keypress on. With reds, sure you can actuate more often and faster, but generally you don't spam the keyboard to just register one keypress and even if you do, you're generally bottoming the keyes out to make sure they register because you don't know where that actuation point is. With browns you can rock on that actuation point up and down with a firm understand of when a key register and when it's done registering.

  10. Re:50 ms? by Anonymous Coward · · Score: 5, Informative

    USB latency is nowhere near 50-100ms, more like 1ms for a low-speed/full-speed device (which most HID devices are). a high speed device could be polled at 8*125us.

    You'd probably need the lousiest USB controllers and a horrible CPU to get anywhere near what you're describing.

    Disclaimer: I've actually worked on USB Host Controller and Device Controller drivers in embedded environments

  11. Re:so this...... by Trogre · · Score: 4, Insightful

    Why the hatred? This seems a genuinely interesting topic to us nerds, whom this site is ostensibly meant to be for.

    As far as Ask Slashdot questions go, this is one of the better ones.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  12. Re:so this...... by Twinbee · · Score: 3, Informative

    You're missing the point. It still adds ON TOP of what would be standard human latency. Given say, a game where milliseconds matter and can make you lose points, this is an issue.

    --
    Why OpalCalc is the best Windows calc
  13. Re:he lost already and browser explains by ahabswhale · · Score: 2

    Jesus you take things way too literally. First off, I said that 1 ms can make the difference between a win and a loss. That's a fact. It doesn't mean I sit there and do everything I can to try and shave 1 ms off of my latency. I go for most bang for the buck first. Yes, skill is the most important thing but if you're 30 ms slower than me on ping, I will rape you in an FPS. I know this because I used to compete with a clan in UT2k4. 30 ms is FOREVER is twitch gaming. So please spare me the patronizing attitude.

    --
    Are agnostics skeptical of unicorns too?
  14. Re:so this...... by Twinbee · · Score: 3, Informative

    Okay, let's say human reaction time 0.3 secs with +-0.1 secs margin of error for simplification. Let's also assume keyboard latency is 0.05 (50 ms). Let's assume the game is a simple reaction test where whoever shoots first after a visual signal is sent is the winner if they get in before their opponent.

    A typical round of 5 games of equal skill could go:
    Player A,B
    0.25, 0.35
    0.21, 0.37
    0.39, 0.3
    0.3, 0.34
    0.31, 0.29 Final score: Player 1: 2 points, Player 2: 3 points

    That was obviously contrived, and I made up the scores. So let's try the best of 10,000 games with a random number generator:
    Player A: 4926
    Player B: 5074

    On first run, not quite 5000 each, but that's well within expected occurrence. Now let's try with a 50 millisecond penalty for player B:

    Player A: 7163
    Player B: 2837

    Wow! Player A is winning almost 3/4s of the games despite only 0.05 secs being added! Such a small amount makes a far bigger difference than you would think.

    For fun, let's try a 10ms penalty for player B:
    Player A: 5453
    Player B: 4547

    Even a measly 10ms makes a significant difference in the long run.

    --
    Why OpalCalc is the best Windows calc
  15. Re:so this...... by Luckyo · · Score: 2

    Let's not make such hilarious sweeping assumptions which carry a huge error margin. Your keyboard latency for example is slightly less then one order of magnitude off. Even more so for PS/2, which is IRQ based port, but regardless...

    I have even better one for you. One of the most if not the most competitive game in the world, League of Legends has had a brilliant example of just how little small mechanical changes in game dynamics actually do. They had a champion who was considered massively underpowered. They posted a patch that apparently buffed him. Suddenly pro circles picked the champion and used him actively with great degree of success. This lasted for a while.

    Then suddenly came the apology from Riot, the company behind the game. They forgot to actually push the changes into the patch.

    Vast majority of competitive scene "little tweaks matter" is same as various variants of snake oil for top athletes. They allow people who are already in extreme shape for their discipline to get the extra "push" from thinking they have an advantage. It's literally all in the head of the recipient. A pure example of placebo effect. Because when you spend a little time actually thinking about it, you'll realize that round trip "signal received in optical nerve, signal transferred into brain, signal processed into thought which produces desire for action, signal is sent to brain area responsible for pressing keys, signal encoded into actual signal that causes finger action, signal is transferred into appropriate muscles, muscles contract causing pressing action" simply takes so long, that a difference of a few milliseconds is simply IRRELEVANT. It is far less then difference between taking that same long neural signal trip on two different occasions. I.e. error margin.

    But reality is, placebo works. As long as you're convinced that you have uber keyboard, you'll likely perform better. Just like athletes who apply snake oil to their bodies before performance will perform better if they believe that snake oil gives them the edge. And the hardware companies want to sell you the expensive snake oil. Win:win.

    Only one problem - it doesn't work on people who don't believe in that variety of snake oil.

  16. Re:PS/2 still FTW by Trogre · · Score: 2

    ATX poweroff. These machines are effectively powered down, ie not in sleep or hibernate modes. In this state most sane BIOSes can respond to PME events such as Wake on LAN (so you can send them a magic packet to turn them on), but none seem to poll for USB events.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife