Problem Hardcoded Vessel Hotkeys

xerzi

New member
Joined
Aug 16, 2011
Messages
4
Reaction score
0
Points
0
I am trying to remap some of the hotkeys to my preferences but some of the hotkeys are hardcoded (such as radiator [D] for the delta glider). I was wondering if there was a way to change this or if anyone has any documentation to how a hotkey is set using the orbitersdk. I took a glimpse at the delta glider source code but I couldn't find any sort of reference directly linking the radiator to the 'D' key.
 
It's on line 4111 in DeltaGlider.cpp:

Code:
// --------------------------------------------------------------
// Process buffered key events
// --------------------------------------------------------------
int DeltaGlider::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
    if (!down) return 0; // only process keydown events
    if (Playback()) return 0; // don't allow manual user input during a playback

    if (KEYMOD_SHIFT (kstate)) {
    } else if (KEYMOD_CONTROL (kstate)) {
        switch (key) {
        case OAPI_KEY_SPACE: // open control dialog
            oapiOpenDialogEx (g_Param.hDLL, IDD_CTRL, Ctrl_DlgProc, DLG_CAPTIONCLOSE, this);
            return 1;
        case OAPI_KEY_B:
            RevertAirbrake ();
            return 1;
        }
    } else {
        switch (key) {
        [COLOR="Red"]case OAPI_KEY_D:  // "operate radiator"
            RevertRadiator ();
            return 1;[/COLOR]
        case OAPI_KEY_G:  // "operate landing gear"
            RevertLandingGear ();
            return 1;
        case OAPI_KEY_K:  // "operate docking port"
            RevertDockingPort ();
            return 1;
        case OAPI_KEY_O:  // "operate outer airlock"
            RevertOuterAirlock ();
            return 1;
        }
    }
    return 0;
}
 
A shim to introduce a keymap config file shouldn't be too hard, but I expect that dbeachy's got a lot better things to be doing with his time...
 
Well he included the source code for the vessel's (which is a lot more than what most people do), it isn't that hard to recompile it so that it has different keys.

Thanks for pointing me in the right direction.
 
BTW, to be clear, the default DeltaGlider code included with Orbiter was written by Martin, not by me. :)
 
Sorry, I thought that was your XR2 code from a quick glance. Either way, the same thing holds. Martin's probably got a lot better things to be doing with his time.
 
Back
Top