Re: [GD-Windows] Input thread
Brought to you by:
vexxed72
From: Pierre T. <p.t...@wa...> - 2003-06-05 18:51:53
|
> Is there any reason why you'd rather write a multithreaded keyboard system > rather than using windows messages or buffered DirectInput? Honestly, I don't know. It's been a long time now, but one year ago (or maybe two) I was using Windows messages in that part of the code, and IIRC I ran into some problems of lost messages. Typically, the "key up" event sometimes was never caught, so for example : - on key down, I was sending a message to a state machine, that eventually made the character walk - key up event was missed - the character kept walking forever That's why I switched to GetAsyncKeyState() in the first place : no messages, just read key status when needed, no problem (at least, no immediate problem). Now, if you all say Windows messages are just fine and can't ever be missed, I probably will try it again. It's very possible the bug was somewhere else (as you see, I'm not exactly working hard on this project since it's already years-old). Usually I don't have to deal with game input code (not exactly needed in my job), that's why I also wanted to avoid DirectInput. Anyway, you pretty much all answered my question : no, what I had in mind isn't a standard thing to do. I suppose Thatcher went that way because it's not a Windows guy, to begin with. Answering your question, that would be "a reason". Maybe the only one. - Pierre |