IsKeyDown getting missed.

Hi folks.

I’m having problems with key presses being missed. I use the normal code, check with IsKeyDown, these are keys that can be held so there is no secondary check against IsKeyUp.

Now and then, when I’m holding down a key, it gets ignored, as if it’s not being held down at all, then I have to let go of the key and press it again. I’ve also noticed there are times when the actual press isn’t processed.

There are several keys in this app that can be held and it happens with all of them. It’s just started doing this yesterday and I have no idea why. I haven’t added anything to the app, just been fiddling with variables, nothing to do with keyboard control.

I would be prepared to believe this was an OS problem, except it happens on 2 of my PC’s, so it has to be an app problem.

Anyone else found this problem, have a reason for it, etc. ?

Many thanks.

I only saw this problem 2 times:

  • with a Logitech keyboard. Uninstalled Logitech’s software and all was ok.
  • on a windows on which repeat keys speed was modified and/or key presses like 5times caplocks, or 5 times alt triggering special windows actions was activated.
    Maybe it will help, maybe it won’t?

Are u holding multiple keys? Some keyboards can’t handle specific key combinations

In the past I only experienced that when my game started ‘stuttering’. Update didn’t get called as often as I wanted to and so it ‘missed’ some input.
But I have no clue what could cause that failure you describe. If you hold the key down it should be bound to register if you wait long enough.

What platform are you targeting?

Have you tried a different keyboard? i have a similar problem with mine, if i press a key, release it and press it again, the keyboard doesn’t detect it, also it doesn’t matter how long i keep pressing the key.

Well, the laptop I’m currently using hasn’t been a problem before, and it runs other Monogame stuff I’ve written without any problems. So does the desktop I’ve tested on.

Most things I write are dependent on keys being held.

I’ve written some test code to cut out swathes of processing and drawing to try to find the problem, so far it’s remaining illusive.