- Joined
- Jun 6, 2012
- Messages
- 283
- Reaction score
- 65
- Points
- 28
- Location
- Sydney, Australia, Earth, Sol
- Website
- www.orbithangar.com
Hi All,
I am trying to develop a simple plugin which interacts with vessels in a simulation (for example refuel all vessels). This is not a dialog box but rather a plugin which when active will always run.
However I cannot seem to be able to record key events.
I can interact with Orbiter's PreStep callback with the code below:
but I cannot seem to do this for the direct key callback. I have this:
but this doesn't work. Am I missing something obvious? I remember I think I grabbed the opcPreStep function from one of the example pluggins in Orbiter's SDK.
Any help would be greatly appreciated,
Thanks in advance!
I am trying to develop a simple plugin which interacts with vessels in a simulation (for example refuel all vessels). This is not a dialog box but rather a plugin which when active will always run.
However I cannot seem to be able to record key events.
I can interact with Orbiter's PreStep callback with the code below:
C++:
DLLCLBK void opcPreStep(double SimT, double SimDT, double mjd)
{
}
but I cannot seem to do this for the direct key callback. I have this:
C++:
DLLCLBK int opcConsumeDirectKey (char *kstate)
{
if(KEYDOWN (kstate, OAPI_KEY_UP)) {
sprintf(oapiDebugString(), "up key pressed");
}
return 0;
}
but this doesn't work. Am I missing something obvious? I remember I think I grabbed the opcPreStep function from one of the example pluggins in Orbiter's SDK.
Any help would be greatly appreciated,
Thanks in advance!