Library tutorials & articles
Direct Input 8
Overview
This article explains how to implement direct input. Direct Input is used to determine the keyboard,
mouse, and joystick device states. Direct Input associates an id with the keyboard, mouse, and joystick
device. Using the device id, properties are set to tell direct input how to return device status data.
A timer event is call twelve time a second to display information queried from the device to the application.
The device information is return in direct input data structures. The device status is either immediate
or buffered. If the device is buffered the device property is changed to allow buffering.
Further in the article the different device modes are explained: immediate, buffered, background, foreground,
and windowskeys.
The dinput.h has the scan code enumerated constants
Sohr = g_pKeyboard->GetDeviceData( sizeof(DIDEVICEOBJECTDATA), didod, &dwElements, 0
);
returns an array of 256 keyboard scan code states
Using the scan code constantsdidod[ DIK_1 ].dwData & 0x80
returns either a 0 or 1didod[ i ].dwOfs
returns the actual scan code
Related articles
Related discussion
-
job vacancy .Net Programmers - ( C# || C++ ) (5 full-time positions)
by tajulz (0 replies)
-
How to store C++ object pointers in Core foundation's ordered collections like CFMutableArrayRef, CFMutableDictionaryRef.
by elizas (0 replies)
-
Binary Studio | software development outsourcing Ukraine
by Soft Industry (5 replies)
-
searhing numeric data in urdu text file.
by adilsajjad (0 replies)
-
Programming MS Visual C++, David J. Kruglinski - missing files needed
by andwan0 (0 replies)
This thread is for discussions of Direct Input 8.