feat(el18): Use trim hats as keys for navigation (#3894)
Co-authored-by: elecpower <neilh713@tpg.com.au> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
elecpower
Peter Feerick
parent
b733ec4eae
commit
f40fa1a64b
@@ -268,6 +268,33 @@ void checkSpeakerVolume()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_HATS_AS_KEYS)
|
||||
void checkHatsAsKeys()
|
||||
{
|
||||
uint8_t hatsMode = g_model.hatsMode == HATSMODE_GLOBAL ? g_eeGeneral.hatsMode
|
||||
: g_model.hatsMode;
|
||||
|
||||
static bool oldHatsModeKeys = hatsMode == HATSMODE_KEYS_ONLY;
|
||||
|
||||
if (hatsMode == HATSMODE_TRIMS_ONLY) {
|
||||
setHatsAsKeys(false);
|
||||
}
|
||||
|
||||
if (hatsMode == HATSMODE_KEYS_ONLY) {
|
||||
setHatsAsKeys(true);
|
||||
}
|
||||
|
||||
bool hatsModeKeys = getHatsAsKeys();
|
||||
|
||||
if (hatsModeKeys == oldHatsModeKeys) return;
|
||||
|
||||
oldHatsModeKeys = !oldHatsModeKeys;
|
||||
|
||||
audioKeyPress();
|
||||
POPUP_BUBBLE(hatsModeKeys ? STR_HATSMODE_KEYS : STR_HATSMODE_TRIMS, 2000);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(EEPROM)
|
||||
void checkEeprom()
|
||||
{
|
||||
@@ -527,6 +554,10 @@ void perMain()
|
||||
|
||||
checkBacklight();
|
||||
|
||||
#if defined(USE_HATS_AS_KEYS)
|
||||
checkHatsAsKeys();
|
||||
#endif
|
||||
|
||||
#if !defined(LIBOPENUI)
|
||||
event_t evt = getEvent();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user