Sign in to follow this  
jdub

[SlimDX]Raw Input or Windows Messages?

Recommended Posts

I just came from XNA and its nice wrappers for getting user input. Now, using SlimDX, without the nice XNA wrappers, I am confused on what would be the best way to get user input. A book I have uses windows messages to get keyboard and mouse input. I also took a look at SlimDX's Raw Input wrappers. I am left with a lot of questions 1) Is it harder to use raw input than windows messages? Will I spend a lot more time? Is it more error prone? Or, is it easier than or only slightly different than using windows messages? 2) What are the pros and Cons to using each/which one do you prefer and why? 3) Are there any good articles on the subject of Raw Input that might help me (other than MSDN's article)? Thanks, jdub

Share this post


Link to post
Share on other sites
The key issue here is that each are good for different things. Generally you'll want to use windows messages for pretty much anything that's not gameplay. For example if you have a mouse cursor for navigating menus, you'll want to use windows messages so that you get ballistics applied to the cursor movement (ballistics causes the pointer to accelerate, without it the mouse will feel very "weird" compared to the windows cursor). For textboxes where the player enters a name or some information, you'll once again want standard windows messages input. That's because this will automatically take care of things like capslock/shift, key repeat, and international keyboards.

Now for gameplay, for instance a first-person shooter where you use mouse input to control free-look, you'll probably want to use Raw Input. In this case you don't have a cursor so you don't want ballistics applied, so that's not an issue. You'll also want to be able to take advantage of high-DPI mouse hardware, which you can only do through Raw Input. Same with the keyboard, where you'll probably just want to know what button is being pressed and you don't care about capitalization or key repeats.

Share this post


Link to post
Share on other sites
So let me get this right:

Raw Input is lower level than using Windows Messages for input and only gives basic information about input?

So Unless I am designing a First Person Shooter or something similar, I should not use Raw Input?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this