Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5729 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, I''m planning to add a HI-Score list to my game. The game is using DirectInput to control my hero. But is there an easy way for making text I/O in a windowed DirectDraw app? Like, for example ''cin''? I thing it will require much work if i should use my direct input function: void ReadImmediateData() { unsigned char diks[256]; if(NULL == g_pKeyboard) return; if(FAILED(g_pKeyboard->GetDeviceState(sizeof(unsigned char[256]), (LPVOID)diks))) { /* error code */ } //''S''-key if(KeyDown(diks, DIK_S) && gameState == GAME_INTRO) { gameState = GAME_ACTIVE; } ... } /Mattias

Share this post

Link to post
Share on other sites
I''ve tried making my own text input reader with DirectInput, but I just couldn''t get it to match Windows'' system and gave up. I found it much easier to use the WM_CHAR message for input, because it handles timing, Caps Lock, etc. for you.

WindowProc (int msg, LPARAM, WPARAM wParam)
if (msg == WM_CHAR)
LetterTyped ((char)wParam);

Something like that.

Share this post

Link to post
Share on other sites

  • 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!