[Rotary encoders] Navigation system reworked
This commit is contained in:
@@ -254,6 +254,9 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
|
||||
KEY_Left, KEY_LEFT,
|
||||
KEY_Up, KEY_UP,
|
||||
KEY_Down, KEY_DOWN,
|
||||
#endif
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
KEY_F, BTN_REa,
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -300,6 +303,21 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
|
||||
simuSetTrim(i, getApp()->getKeyState(trimKeys[i]));
|
||||
}
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
static bool rotencAction = false;
|
||||
if (getApp()->getKeyState(KEY_G)) {
|
||||
if (!rotencAction) g_rotenc[0] += ROTARY_ENCODER_GRANULARITY;
|
||||
rotencAction = true;
|
||||
}
|
||||
else if (getApp()->getKeyState(KEY_D)) {
|
||||
if (!rotencAction) g_rotenc[0] -= ROTARY_ENCODER_GRANULARITY;
|
||||
rotencAction = true;
|
||||
}
|
||||
else {
|
||||
rotencAction = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SWITCH_KEY(key, swtch, states) \
|
||||
static bool state##key = 0; \
|
||||
static int8_t state_##swtch = 2; \
|
||||
|
||||
Reference in New Issue
Block a user