Step 5: Gaining Access to the Keyboard
Microsoft DirectX 9.0 SDK Update (October 2004)

Step 5: Gaining Access to the Keyboard


After your application sets the keyboard's behavior, it can acquire access to the device by calling the IDirectInputDevice8::Acquire method. The application must acquire the device before retrieving data from it. The IDirectInputDevice8::Acquire method accepts no parameters.

The following line of sample code acquires the keyboard device that was created in Step 2: Creating the DirectInput Keyboard Device.

if (g_lpDIDevice) g_lpDIDevice->Acquire(); 

Now that your application has acquired access to the keyboard, go to Step 6: Retrieving Data from the Keyboard.



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.