Try another keyboard if you got one laying about, if not you got a rl buddy with a keyboard you can barrow to use to do a test. If no then hit up a walmart or any other retailer and buy cheap $10 kb to do a test. I be honest sounds like your current kb is dying with a short in its cord.
Edit: Never thought could be on wireless kb in that case make sure it's fully charged lol
Still testing a different kb is right path if by chance that changes nothing try a different USB port if using usb port for kb even wireless.
I know you say "only happens in d2" but that doesn't change the troubleshooting methods.
Tons of aliments I've ran into that only happen in certain games and still be a hardware issue.
If it was game related issue purely, as many people that do play be more than just yourself posting about this, this is why I'm assuming it's your hardware related. With that said it is why i say test a different kb if that don't solve try another usb port. USB ports can screw up or die to. I recently had a mouse die it was randomly double clicking but I only noticed it in d2 changed the mouse the issue went away.
English
-
I've actually gone through 3 keyboards while playing the game and the input issue has happened every time. I'll switch up the usb port tho and see if that does anything.
-
Alright let me know how it goes take care