Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple raw input implementation
07-07-2013, 12:37 AM
Post: #1
Simple raw input implementation
Playing around with implementing raw input, for whatever that's worth. The data from WM_INPUT events is queued up and consumed by KeyboardDevice later. Doesn't really feel any different to me in practice than the old GetAsyncKeyState() stuff, but whatever. Only tried it with a few games but seems alright.

https://github.com/dykebeard

test build
https://docs.google.com/file/d/0B359Nkrk...sp=sharing
Find all posts by this user
Quote this message in a reply
07-07-2013, 05:48 AM
Post: #2
RE: Simple raw input implementation
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]
Find all posts by this user
Quote this message in a reply
07-07-2013, 07:15 AM (This post was last modified: 07-07-2013 07:23 AM by dykebeard.)
Post: #3
RE: Simple raw input implementation
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.
Find all posts by this user
Quote this message in a reply
07-07-2013, 10:46 AM (This post was last modified: 07-07-2013 10:46 AM by Henrik.)
Post: #4
RE: Simple raw input implementation
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: