Microsoft DirectX 8.1 (Visual Basic) |
When Microsoft® DirectInput® input data is buffered (see Buffered and Immediate Data), each DIDEVICEOBJECTDATA type contains not only information about the type of event and the device object associated with it. It also contains a time stamp and a sequence number.
The lTimeStamp member contains the system time, in milliseconds, at which the event took place. This is equivalent to the value that would have been returned by the Microsoft Win32® GetTickCount function, but at a higher resolution.
The lSequence member contains a sequence number assigned by DirectInput. The DirectInput system keeps a single sequence counter, which is incremented by each buffered event from any device. (Simultaneous events on the same device, such as diagonal mouse movements, increment the count only once.) Use this number to compare events from different devices and see which came first.
Note Events are always placed in the buffer in chronological order, so you don't need to check the sequence numbers to sort the events from a single device.