Acquiring the Device

The last step in the process is to acquire the keyboard device using the Acquire function. If the function returns a positive value (DI_OK), then you have successfully acquired the keyboard and you are ready to start checking for key presses.

Remember to always release the keyboard when you are done using it, or you could leave the keyboard handler in an unknown state. You cannot rely on Windows or DirectInput to clean up after you. Each DirectInput device has an Unacquire function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset