- Messages
- 531
- Country
Hello experts,
I know how to use DirectInput to read a DirectX device status, axis and buttons, no problem. The question I have here is about the ability to read a button status even if nothing happens, no user action.
What I mean here is that DirectInput is event-based, it will give you the status of a button only when it is pressed or released. Most of the time, this is OK. But for some specific devices, such as the Honeycomb yoke, buttons are used with switches: when off, it appears as a released button and when on, it appears as a pressed button. Consequently, there might be a discrepancy between the real device and its counterpart in the sim. For example, if I have a switch mapped for the battery, when I start the sim the battery is OFF, and if the physical switch is ON, it is not consistent.
This is why I ask: is there a way to interrogate the switch status to position the switch in the sim accordingly?
In that example, I would read the switch status, and if I see it is ON, I turn on the battery in my initialization sequence.
I couldn't find a way to do it. I was able to read the switch status only if it is moved, If the status changes. If there is a way to do it, I would be glad to know.
Thanks,
Eric
I know how to use DirectInput to read a DirectX device status, axis and buttons, no problem. The question I have here is about the ability to read a button status even if nothing happens, no user action.
What I mean here is that DirectInput is event-based, it will give you the status of a button only when it is pressed or released. Most of the time, this is OK. But for some specific devices, such as the Honeycomb yoke, buttons are used with switches: when off, it appears as a released button and when on, it appears as a pressed button. Consequently, there might be a discrepancy between the real device and its counterpart in the sim. For example, if I have a switch mapped for the battery, when I start the sim the battery is OFF, and if the physical switch is ON, it is not consistent.
This is why I ask: is there a way to interrogate the switch status to position the switch in the sim accordingly?
In that example, I would read the switch status, and if I see it is ON, I turn on the battery in my initialization sequence.
I couldn't find a way to do it. I was able to read the switch status only if it is moved, If the status changes. If there is a way to do it, I would be glad to know.
Thanks,
Eric