[Rotary encoders] Navigation system reworked

This commit is contained in:
bsongis
2013-02-13 06:35:45 +00:00
parent d7bb012f16
commit e616c4674d
24 changed files with 417 additions and 432 deletions
+18
View File
@@ -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; \