Jump to content
  • Advertisement
Sign in to follow this  
timaer

how to get the keyboard input without Win32 API?

This topic is 4583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,everybody,I'm considering make a Game UI using DirectDraw and DirectInput,but I met some problem. I know how to use the DirectInput to detect the mouse's state and the key's state such as DOWN or UP,but I don't know how to receive the user's keyboard's input,since I only use DirectDraw to render the dialog and other things,I don't want to use Win32 controls and process the message such like WM_XXX. Does anyone know anyway to do so? If I need to make a Login Dialog,receive the user's input and check the password ,How can I do it with the DInput and DDraw,and without knowing the Win32 API and WM_XXX message processing.Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
The DirectX FAQ has plenty of DX tutorials, many of them include DirectInput tutorials that cover both Mouse and Keyboard input.

If I where you I'd stick to Win API though.

Share this post


Link to post
Share on other sites
Thanks Fluffy-Bunny,Calin,rpg_code_master,I've downloaded the direct input wrapper,but I found there was only something basic,all about the processing the state of the keyboard.

And I need the pressed key's character and test the text string whether the "user name" and "password" is correct,I know it'll be easy for using Win32 API,but I dont know how to do it using Directdraw+Dinput(because that can get a more impressive appearence).


Ps:Maybe because I learn not too much about the DirectInput,in my mind,I only see the DirectInput can get the state of the keyboard?(Can we only determine whether the key pressed DOWN or UP but can't know what the user has input?)

Share this post


Link to post
Share on other sites
Quote:
Original post by rpg_code_master
Or depending on how hardcore you are, you could use raw ASM, HEX or even Binary if you know how [grin]
No, you can't. If you're coding a 16 bit DOS program you can call interrupts (the entire thing is emulated). Otherwise, you have to talk to Windows (but not necessarily Win32).

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Why don't you want to use Win32?




HI,Steve,I suppose that's because I think the standard Win32 's appearence is too common,and it seems we dont have much control of the appearence of them,like customizing them.I want to use DirectDraw to make the UI appearence more impressive.

Share this post


Link to post
Share on other sites
Quote:
Original post by timaer
Quote:
Original post by Evil Steve
Why don't you want to use Win32?

HI,Steve,I suppose that's because I think the standard Win32 's appearence is too common,and it seems we dont have much control of the appearence of them,like customizing them.I want to use DirectDraw to make the UI appearence more impressive.

No, he means for input. Why do you want to use DirectInput to simulate what the Win32 API does natively?

Besides, it's increasingly recommended to use WM_INPUT over DirectInput.

Share this post


Link to post
Share on other sites
Quote:
Original post by timaer
HI,Steve,I suppose that's because I think the standard Win32 's appearence is too common,and it seems we dont have much control of the appearence of them,like customizing them.I want to use DirectDraw to make the UI appearence more impressive.
I should have been clearer [smile] I meant, why don't you want to use Win32 for the window messages? You can still use Win32 messages for the message pump, and render the controls how you wish. It'd probably be easier to use window messages for handling text input, since they deal with switching to system menus, upper/lowercase letters, etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!