Learn about DirectInput

xiaoxiao2021-03-06  73

Learn about DirectInput

This section mainly introduces the underlying structure of Microsoft DirectInput and its relationship with the Microsoft Windows message system.

DirectInput object interact with Windows

DirectInput implementation, refer to "Application DirectInput".

DirectInput object

A DirectInput's dedicated input implementation consists of a DirectInput object that supports the IDirectInput8 COM interface and accesss data for each input device through the DirectInputDevice object. Each DirectInputDevice object session contains device objects, separate controllers, or converters such as buttons, buttons, or axes. Equipment objects are also known as the device object instance here.

A DirectInputDevice object represents an input device such as a mouse, a keyboard, or a joystick. In the DirectInput's API, Joystick is an apparatus that is unlike a mouse or keyboard. Some hardware is actually a combination of different types of input devices, such as a keyboard with a touchpad, can represent two or more DirectInputDevice objects. The force feedback device can be represented by a single alone containing an input and output.

The DirectInputDevice object is an instance of the IdirectInputDevice8 interface. The application can determine the number and type of the available device objects via the iDirectinputDevice8 :: EnumiCTS method. Individual device objects are not packaged into code objects, but are described in the DideviceObjectInstance structure.

The effect of force feedback is represented by the iDirectInputEffect interface that includes methods for creating, modifying, starting, and stopping.

All DirectInput interfaces include ANSI and Unicode implementations, if you have defined Unicode, you will use the Unicode version.

Interact with Windows

Since DirectInput interacts directly with the device driver, it can cancel or ignore the Windows mouse and keyboard messages. It is also possible to ignore the settings of the keyboard and mouse in the control panel. But it is still used to set up the game pole or other game controller.

DirectInput does not recognize the repetition setting of the keyboard character (the translator's note should be said that a series of messages will be generated when a button is time longer than if a button is pressed?). When using buffer data, DirectInput will treat each press and release as a separate event and do not generate a copy. When using immediate data, DirectInput will only focus on the status of the current button, not the so-called keyboard events of Windows.

DirectInput does not implement character conversion or transformation. For example, the SHIFT button will treat the same, not the modifier of another key. Regardless of the user's system language setting, the button will always return the same identity.

In Windows 2000, the keyboard in the mutex mode will be obtained, and other subsequent applications will receive keyboard data.

Because DirectInput directly accesses the mouse drive, it will bypass the Windows mouse data interpretation subsystem. Applications relying on mouse cursor navigation should continue to use standard Windows mouse messages and Microsoft Win32 functions.

When using a system mouse in a mutex mode, DirectInput will delete a mouse message, so Windows will not display a standard cursor.

DirectInput will ignore the settings in the control panel, such as acceleration, buttons. But DirectInput will identify the settings in the drive. If the user has a three-way mouse and uses the drive utility to set the middle button to double-click, DirectInput will report to the two primary keys when you click the middle button.

Original: Understanding DirectInput, DirectX SDK © 2004 Microsoft Corporation. All Rights Reserved.

Translation: Room3rd @ Hotmail.com, 2004-11-27

转载请注明原文地址:https://www.9cbs.com/read-87102.html

New Post(0)