Jump to content
  • Advertisement
Sign in to follow this  
Raeldor

Writing to Keyboard Buffer

This topic is 4386 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 All, Is there any way to write directly into the keyboard buffer in a way that DirectInput would be able to pick up? I am writing an emulator that converts input from a head tracker into key presses that a game can pick up. Any pointers would be appreciated. Thanks! Rael

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Raeldor
Hi All,

Is there any way to write directly into the keyboard buffer in a way that DirectInput would be able to pick up? I am writing an emulator that converts input from a head tracker into key presses that a game can pick up.

Any pointers would be appreciated.
Thanks!
Rael
Nope. If you want to add keystrokes to another application that's using DirectInput, you should hook the DLL (Where you supply a fake dinput8.dll which just calls functions from the real DLL). If it's your own application, then you should avoid DInput in the first place - Microsoft recommends using WM_CHAR and WM_MOUSEMOVE for normal usage, and WM_INPUT for high-DPI devices.

There's plenty of samples on the Internet for hooking Direct3D, and the exact same process can be applied to DirectInput. You write a DLL with one exported function - DirectInput8Create(), and that function loads the real DLL (usually from the Windows system folder), and returns a proxy interface. The proxy interface is just a class that derives from IDirectInput8, and implements all the functions. Again, most functions will simply call the real DInput functions, apart from the few you want to change.

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!