Problem KEYMOD_SHIFT only recognizing L-Shift

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,303
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
In building my next addon, I've discovered that sometimes Orbiter only recognizes the Left Shift sometimes key even though I use KEYMOD_SHIFT(keystate).
Code:
int S_S_M::clbkConsumeBufferedKey(DWORD key, bool down, char *keystate)
{
    if(!down)
    {
        return 0;
    }
    if(KEYMOD_SHIFT (keystate))
    {
        switch(key)
        {
        case OAPI_KEY_J:
            return keyShiftSolar();
        }
    }
    else
    {
        switch(key)
        {
        case OAPI_KEY_K:
            return keyDish();        
        case OAPI_KEY_J:
            return keySolar();
        }
    }
    return 0;
}
Sometimes it recognizes left and right shift, and sometimes just the left shift. Is this something I have to work around, or something I've messed up? Whenever it doesn't recognize the right shift button, it only reads the other key I'm pressing (in this case J).
Thanks for any help,
Zat
 
Sometimes it recognizes left and right shift, and sometimes just the left shift. Is this something I have to work around, or something I've messed up? Whenever it doesn't recognize the right shift button, it only reads the other key I'm pressing (in this case J).
Do you have any MFDs open? Perhaps the right MFDs is consuming the buffered key first?
 
Keyboard combinations with shift are reserved for MFDs, and therefore should not be used. You can always use control...
 
Well changing to control did work thanks. There should be a note somewhere in the API or something :P Shift is just way more convenient for the J key so that's why I used it.
 
Back
Top