Posts: 3,228
Threads: 25
Joined: Nov 2012
Reputation:
98
Hmm, I'm not sure about that Sleep(5) thing.
It'd be interesting to know if RAWINPUT improves latency over WM_KEYDOWN (or certainly GetAsyncKeyState once per frame) for e.g. games like Patapon and DJ Max.
-[Unknown]
Posts: 2
Threads: 1
Joined: Jul 2013
Reputation:
0
07-07-2013, 07:15 AM
(This post was last modified: 07-07-2013, 07:23 AM by dykebeard.)
Yeah, the Sleep() is sketchy for sure. It's probably the right thing to just get rid of it, but I think a tiny one would be alright. Maybe just Sleeping if the window is minimized / not in focus would be smarter.
I'm not sure if WM_INPUT will be noticeably better off than WM_KEYDOWN performance wise, but we can also probably grab data for a controller in the future. I'm not sure how compatibility with different controllers will be, but everything could get potentially handled in one spot. It should be better off than GetAsyncKeyState() though, as it was probably possible to miss input.
Posts: 2,079
Threads: 62
Joined: Jun 2012
Reputation:
154
07-07-2013, 10:46 AM
(This post was last modified: 07-07-2013, 10:46 AM by Henrik.)
I've implemented RAWINPUT now, and also made sure that keys aren't queued at all. I haven't noticed much latency improvement though, but there might be some.
GetAsyncKeyState is no more, except for a couple of special keys. I'll get rid of that soon.