Archived

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

Cdt Sgt Dolman

Game command console with Direct Input action mapping

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