I'm writing an MFD and I need help with a certain type of keypresses. For some reason the ships functions that respond to a keydown like the brakes I cannot send the ship the key.
Here's the code I'm using currently. I'm not sure if this makes a difference but all my processing coding is being called on "opcPreStep". For debugging I put these lines in a location where they are being called on every time step.
Vessel->SendBufferedKey(OAPI_KEY_COMMA, true);
Vessel->SendBufferedKey(OAPI_KEY_PERIOD, true);
the following code:
sprintf (oapiDebugString(), "LB %i RB %i", mV->SendBufferedKey(OAPI_KEY_COMMA, true), mV->SendBufferedKey(OAPI_KEY_PERIOD, true));
returns:
"LB 0 RB 0"
Stating that the keydown calls are NOT being sent.
The doc's have a keystate section. Though it compiles without it so I'm not sure if it's needed. If I need the keystate then could someone explain a little on how they are supposed to be used. That part confused me.
From doc:
int VESSEL::SendBufferedKey ( DWORD key, bool down = true, char * kstate = 0)
Anyone know what I am doing wrong here?
Here's the code I'm using currently. I'm not sure if this makes a difference but all my processing coding is being called on "opcPreStep". For debugging I put these lines in a location where they are being called on every time step.
Vessel->SendBufferedKey(OAPI_KEY_COMMA, true);
Vessel->SendBufferedKey(OAPI_KEY_PERIOD, true);
the following code:
sprintf (oapiDebugString(), "LB %i RB %i", mV->SendBufferedKey(OAPI_KEY_COMMA, true), mV->SendBufferedKey(OAPI_KEY_PERIOD, true));
returns:
"LB 0 RB 0"
Stating that the keydown calls are NOT being sent.
The doc's have a keystate section. Though it compiles without it so I'm not sure if it's needed. If I need the keystate then could someone explain a little on how they are supposed to be used. That part confused me.
From doc:
int VESSEL::SendBufferedKey ( DWORD key, bool down = true, char * kstate = 0)
Anyone know what I am doing wrong here?
Last edited: