Jump to content
  • Advertisement

Archived

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

Game command console with Direct Input action mapping

This topic is 5298 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 writing a game with the standard DirectX 9 appwiz framework. For some time I’ve been trying to implement a command console, but Direct Input is making it difficult for me. Is there an easy way to re-map the keyboard to being used for normal input and then remap it back to its action map after the console becomes non-active. The closest I’ve got to it working is mapping the keyboard for normal use, but have not been able to re-map it back when the console is closed. My approach has been before the pdidDevice->Acquire(); in UpdateInput( UserInput* pUserInput ) I have added if(m_bActiveConsole) pdidDevice->SetDataFormat(&c_dfDIKeyboard); This works fine for getting the input to the console, but after the console closes m_bActiveConsole is false but the DirectInput action mapping is not resorted to the application''s action map (the mapped key no longer work).

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I beleive you should Unacquire() the device, then you will start receiving key messages. That is what you should use for a console. Then, when the console is not being used, Acquire() it, and you will stop getting messages and you will be able to use the device.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!