Programming Question Lost Keyboard Activation

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Hi,
Having compiled an aircraft module, I now have no keyboard activation of HOLDALT (A) or HORLVL (L). They still work if I click on in Generic Cockpit though ????
Any ideas how I've managed to do this?
If anyone knows me, remember my "limited" prog. skills !
regards,
JMW
PS.
Got an update to the Aircraft Refuel Project coming soon + (if I can get this remedied) a beautiful (if I may say so ) revamp of Kev33's AH-64 'copter. :)
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
Do you have a clbkConsumeBufferedKey method in your module?

If so, make sure that it will return 0 for A and L (and all other keys that you are not processing).
 

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Hi Hielor,
Yeah, I have this in the code;

// Keyboard interface handler (buffered key events)
// --------------------------------------------------------------
int ShuttlePB::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
if (!down) return 0; // only process keydown events


switch (key) {

But, I also get this warning in the log;

1>c:\orbitersts\orbitersdk\samples\shuttlepb\k-ah-64a.cpp(1189) : warning C4715: 'ShuttlePB::clbkConsumeBufferedKey' : not all control paths return a value

What's it telling me?
JMW
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
Hi Hielor,
Yeah, I have this in the code;

// Keyboard interface handler (buffered key events)
// --------------------------------------------------------------
int ShuttlePB::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
if (!down) return 0; // only process keydown events


switch (key) {

But, I also get this warning in the log;

1>c:eek:rbiterstsorbitersdksamplesshuttlepbk-ah-64a.cpp(1189) : warning C4715: 'ShuttlePB::clbkConsumeBufferedKey' : not all control paths return a value

What's it telling me?
JMW

At the very end of the function, right before the closing }, (after the end of your switch statement), put:
Code:
return 0;

That warning message is saying that there are some paths through your code that do not result in a value being returned, which means that you need a default return value in the event that you don't handle it.
 
Top