mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 03:49:52 +03:00
[X9E/X7D] Rotary encoder navigation speed implemented (#3724)
This commit is contained in:
parent
3cb64d984a
commit
1d735f2bd3
114 changed files with 785 additions and 865 deletions
|
@ -358,20 +358,14 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
|
|||
|
||||
updateKeysAndSwitches();
|
||||
|
||||
#if defined(PCBHORUS) || defined(PCBFLAMENCO)
|
||||
#define ROTENC_VALUE rotencValue
|
||||
#else
|
||||
#define ROTENC_VALUE g_rotenc[0]
|
||||
#endif
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION) || defined(PCBHORUS) || defined(PCBFLAMENCO)
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
static bool rotencAction = false;
|
||||
if (getApp()->getKeyState(KEY_X)) {
|
||||
if (!rotencAction) ROTENC_VALUE += ROTARY_ENCODER_GRANULARITY;
|
||||
if (!rotencAction) ROTARY_ENCODER_NAVIGATION_VALUE += ROTARY_ENCODER_GRANULARITY;
|
||||
rotencAction = true;
|
||||
}
|
||||
else if (getApp()->getKeyState(KEY_W)) {
|
||||
if (!rotencAction) ROTENC_VALUE -= ROTARY_ENCODER_GRANULARITY;
|
||||
if (!rotencAction) ROTARY_ENCODER_NAVIGATION_VALUE -= ROTARY_ENCODER_GRANULARITY;
|
||||
rotencAction = true;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue