mirror of
https://github.com/Ralim/IronOS.git
synced 2025-07-23 12:23:06 +02:00
Add option to swap A/B buttons in Settings menu with minimal changes (#2034)
This commit is contained in:
@@ -275,6 +275,10 @@
|
||||
"displayText": "Інвертаваць\nкнопкі",
|
||||
"description": "Інвертаваць кнопкі вымярэння тэмпературы"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Хуткасць\nанімацыі",
|
||||
"description": "Хуткасць анімацыі гузікаў у галоўным меню (Мілісекунды) (Н=Нізкая | С=Сярэдняя | В=Высокая)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Размяна\nбутони +/-",
|
||||
"description": "Обръщане на бутоните + и - за промяна на температурата на човка на поялника"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Скорост на\nанимацията",
|
||||
"description": "Скорост на анимация на иконата в главното меню (Н=Ниска | C=Средна | B=Висока)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Prohodit\ntl. +-?",
|
||||
"description": "Prohodit tlačítka pro změnu teploty"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nrychlost",
|
||||
"description": "Tempo animace ikon v menu (P=pomalu | S=středně | R=rychle)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Skift\n+ - tasterne",
|
||||
"description": "Skift tildeling af knapper til temperaturjustering"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nHastighed",
|
||||
"description": "Hastigheden for ikonanimationer i menuen (S=langsomt | M=medium | F=hurtigt)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "+- Tasten\numkehren",
|
||||
"description": "Tastenbelegung zur Temperaturänderung umkehren"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nGeschw.",
|
||||
"description": "Geschwindigkeit der Icon-Animationen im Menü (L=langsam | M=mittel | S=schnell)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Αντιστροφή\nπλήκτρων + -",
|
||||
"description": "Αντιστροφή διάταξης πλήκτρων στη ρύθμιση θερμοκρασίας"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Ταχύτητα\nκιν. εικονιδ.",
|
||||
"description": "Ρυθμός κίνησης εικονιδίων στο μενού (Α=αργός | Μ=μέτριος | Γ=γρήγορος)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Swap\n+ - keys",
|
||||
"description": "Reverse assignment of buttons for temperature adjustment"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nspeed",
|
||||
"description": "Pace of icon animations in menu (S=slow | M=medium | F=fast)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Invertir\nbotones +/-",
|
||||
"description": "Invertir botones de ajuste de temperatura"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nvelocidad",
|
||||
"description": "Velocidad de animaciones de iconos en el menú (L=baja | M=media | R=alta)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Vaheta\n+ - nupud",
|
||||
"description": "Temperatuurinuppude asukohtade vahetus"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nkiirus",
|
||||
"description": "Menüüikoonide animatsiooni kiirus (A=aeglane | K=keskmine | T=tempokas)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Suunnanvaihto\n+ - näppäimille",
|
||||
"description": "Lämpötilapainikkeiden suunnan vaihtaminen"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Animaation\nnopeus",
|
||||
"description": "Animaatioiden nopeus valikossa (A=alhainen | K=keskiverto | S=suuri)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Inverser les\ntouches + -",
|
||||
"description": "Inverser les boutons d'ajustement de température"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Vitesse\nanim. icônes",
|
||||
"description": "Vitesse des animations des icônes dans le menu (L=lente | M=moyenne | R=rapide)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Zamjena\n+ - tipki",
|
||||
"description": "Zamjenjuje funkciju gornje i donje tipke za podešavanje temperature"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Brzina\nanimacije",
|
||||
"description": "Brzina animacije ikona u menijima (S=sporo | M=srednje | B=brzo)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "+/- gomb\nmegfordítása",
|
||||
"description": "Forrasztó hegy hőmérsékletállító gombok felcserélése"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Animáció\nsebessége",
|
||||
"description": "Menüikonok animációjának sebessége (L=lassú | K=közepes | Gy=gyors)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Inversione\ntasti",
|
||||
"description": "Inverti i tasti per aumentare o diminuire la temperatura della punta"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Velocità\nanimazioni",
|
||||
"description": "Imposta la velocità di riproduzione delle animazioni del menù principale [L: lenta; M: media; V: veloce]"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "キー入れ替え",
|
||||
"description": "温度設定時に+ボタンと-ボタンを入れ替える"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "動画の速度",
|
||||
"description": "メニューアイコンのアニメーションの速さ <遅=低速 | 中=中速 | 速=高速>"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Sukeisti + -\nmygtukus?",
|
||||
"description": "Sukeisti + - temperatūros keitimo mygtukus vietomis"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Animacijų\ngreitis",
|
||||
"description": "Paveiksliukų animacijų greitis meniu punktuose (L=Lėtas | V=Vidutinis | G=Greitas)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Bytt\n+ - kn.",
|
||||
"description": "Bytt om på knappene for å stille temperatur"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nhastighet",
|
||||
"description": "Hastigheten til animasjonene i menyen (S=slow | M=medium | F=fast)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Wissel\n+ - knoppen",
|
||||
"description": "Wissel de knoppen voor temperatuur controle om"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nsnelheid",
|
||||
"description": "Snelheid van de icoon animaties in het menu (Langzaam | Middel | Snel)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Wissel\n+ - knoppen",
|
||||
"description": "Wissel de knoppen voor temperatuur controle"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nsnelheid",
|
||||
"description": "Snelheid van de icoon animaties in het menu (T=sloom | M=middel | S=snel)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Zamień przyc.\n+ -",
|
||||
"description": "Zamienia działanie przycisków zmiany temperatury grotu"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Prędkosć\nanimacji",
|
||||
"description": "Prędkość animacji ikon w menu (W: mała | M: średnia | S: duża)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Trocar\nbotões + -",
|
||||
"description": "Inverte o funcionamento dos botões de ajuste da temperatura"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Velocidade\nde animação",
|
||||
"description": "Velocidade das animações no menu (S=lenta | M=média | F=rápida)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Inversare\n+ - butoane",
|
||||
"description": "Inversarea butoanelor de reglare a temperaturii"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Animaţii\nviteză",
|
||||
"description": "Ritmul animaţiilor pictogramei din meniu (Î=încet | M=mediu | R=rapid)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Поменять\nкнопки +/-",
|
||||
"description": "Поменять кнопки изменения температуры"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Скорость\nанимации",
|
||||
"description": "Скорость анимации иконок в главном меню (М=Медленная| С=Средняя | Б=Быстрая)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Otočenie\ntlačidiel +/-",
|
||||
"description": "Prehodenie tlačidiel na nastavovanie teploty"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Rýchlosť\nanimácií",
|
||||
"description": "Rýchlosť animácií ikoniek v menu (P=pomaly | S=stredne | R=rýchlo)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Obrni\ntipki + -?",
|
||||
"description": "Zamenjaj funkciji gumbov."
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nspeed",
|
||||
"description": "Pace of icon animations in menu (P=slow | M=medium | H=fast)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Swap\n+ - keys",
|
||||
"description": "Reverse assignment of buttons for temperature adjustment"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nspeed",
|
||||
"description": "Pace of icon animations in menu (С=slow | M=medium | Б=fast)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Swap\n+ - keys",
|
||||
"description": "Reverse assignment of buttons for temperature adjustment"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\nspeed",
|
||||
"description": "Pace of icon animations in menu (S=slow | M=medium | B=fast)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Omvända\n+- knappar",
|
||||
"description": "Omvänd ordning för temperaturjustering via plus/minus knapparna"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.-\nhastighet",
|
||||
"description": "Animationshastighet för ikoner i menyer (L=långsam | M=medel | S=snabb)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Düğme Yerleri\nRotasyonu",
|
||||
"description": "\"Düğme Yerleri Rotasyonu\" Sıcaklık ayar düğmelerinin yerini değiştirin"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Animasyon\nHızı",
|
||||
"description": "Menüdeki simge animasyonlarının hızı (Y=Yavaş | O=Orta | H=Hızlı)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Інвертувати\nкнопки +-?",
|
||||
"description": "Інвертувати кнопки зміни температури."
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Швидкість\nанімації",
|
||||
"description": "Швидкість анімації іконок у меню (Н=Низькa | С=Середня | М=Максимальна)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "(+) va (-) tugmalarni\nalmashtirish",
|
||||
"description": "Harorat o'zgarishi uchun tugmachalarni vazifasini almashish"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Anim.\ntezligi",
|
||||
"description": "Menyudagi ikonka animatsiyalari tezligini sozlash (S=sekin | O=o'rtacha | T=tez)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "Đao nguoc\nnút + -",
|
||||
"description": "Đao nguoc chuc năng các nút đieu chinh nhiet đo"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Toc đo\nhoat anh",
|
||||
"description": "Toc đo cua hoat anh menu (S=cham | M=trung bình | F=nhanh)"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "反轉加減掣",
|
||||
"description": "反轉調校温度時加減掣嘅方向"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "動畫速度",
|
||||
"description": "功能表圖示動畫嘅速度 <慢=慢速 | 中=中速 | 快=快速>"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "调换加减键",
|
||||
"description": "调校温度时更换加减键的方向"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "动画速度",
|
||||
"description": "主菜单中功能图标动画的播放速度 <慢=慢速 | 中=中速 | 快=快速>"
|
||||
|
@@ -275,6 +275,10 @@
|
||||
"displayText": "調換加減鍵",
|
||||
"description": "調校溫度時調換加減鍵的方向"
|
||||
},
|
||||
"ReverseButtonSettings": {
|
||||
"displayText": "Swap\nA B keys",
|
||||
"description": "Reverse assignment of buttons for Settings menu"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "動畫速度",
|
||||
"description": "功能表圖示動畫的速度 <慢=慢速 | 中=中速 | 快=快速>"
|
||||
|
@@ -473,6 +473,12 @@
|
||||
"maxLen2": 15,
|
||||
"description": "Swaps which button increments and decrements on temperature change screens."
|
||||
},
|
||||
{
|
||||
"id": "ReverseButtonSettings",
|
||||
"maxLen": 6,
|
||||
"maxLen2": 15,
|
||||
"description": "Swaps which button is used as Enter/Change and as Scroll/Back in Settings menu."
|
||||
},
|
||||
{
|
||||
"id": "AnimSpeed",
|
||||
"maxLen": 6,
|
||||
|
@@ -76,8 +76,9 @@ enum SettingsOptions {
|
||||
ProfileCooldownSpeed = 52, // Maximum allowed cooldown speed in degrees per second
|
||||
HallEffectSleepTime = 53, // Seconds (/5) timeout to sleep when hall effect over threshold
|
||||
SolderingTipType = 54, // Selecting the type of soldering tip fitted
|
||||
ReverseButtonSettings = 55, // Change the A and B button assigment in Settings menu
|
||||
//
|
||||
SettingsOptionsLength = 55, // End marker
|
||||
SettingsOptionsLength = 56, // End marker
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
@@ -90,6 +90,7 @@ enum class SettingsItemIndex : uint8_t {
|
||||
CooldownBlink,
|
||||
ScrollingSpeed,
|
||||
ReverseButtonTempChange,
|
||||
ReverseButtonSettings,
|
||||
AnimSpeed,
|
||||
AnimLoop,
|
||||
Brightness,
|
||||
|
@@ -110,6 +110,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
||||
{ 1, 10, 1, 2}, // ProfileCooldownSpeed
|
||||
{ 0, 12, 1, 0}, // HallEffectSleepTime
|
||||
{ 0, (tipType_t::TIP_TYPE_MAX - 1) > 0 ? (tipType_t::TIP_TYPE_MAX - 1) : 0, 1, 0}, // SolderingTipType
|
||||
{ 0, 1, 1, 1}, // ReverseButtonSettings
|
||||
};
|
||||
static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));
|
||||
|
||||
|
@@ -47,6 +47,7 @@ static void displayAdvancedSolderingScreens(void);
|
||||
static void displayAdvancedIDLEScreens(void);
|
||||
static void displayScrollSpeed(void);
|
||||
static void displayReverseButtonTempChangeEnabled(void);
|
||||
static void displayReverseButtonSettings(void);
|
||||
static void displayPowerLimit(void);
|
||||
|
||||
#ifdef BLE_ENABLED
|
||||
@@ -395,6 +396,8 @@ const menuitem UIMenu[] = {
|
||||
{SETTINGS_DESC(SettingsItemIndex::ScrollingSpeed), nullptr, displayScrollSpeed, nullptr, SettingsOptions::DescriptionScrollSpeed, SettingsItemIndex::ScrollingSpeed, 7},
|
||||
/* Reverse Temp change buttons +/- */
|
||||
{SETTINGS_DESC(SettingsItemIndex::ReverseButtonTempChange), nullptr, displayReverseButtonTempChangeEnabled, nullptr, SettingsOptions::ReverseButtonTempChangeEnabled, SettingsItemIndex::ReverseButtonTempChange, 7},
|
||||
/* Reverse Settings menu buttons A/B */
|
||||
{SETTINGS_DESC(SettingsItemIndex::ReverseButtonSettings), nullptr, displayReverseButtonSettings, nullptr, SettingsOptions::ReverseButtonSettings, SettingsItemIndex::ReverseButtonSettings, 7},
|
||||
/* Animation Speed adjustment */
|
||||
{SETTINGS_DESC(SettingsItemIndex::AnimSpeed), nullptr, displayAnimationSpeed, nullptr, SettingsOptions::AnimationSpeed, SettingsItemIndex::AnimSpeed, 7},
|
||||
/* Animation Loop switch */
|
||||
@@ -853,6 +856,8 @@ static void displayScrollSpeed(void) { OLED::print(translatedString((getSettingV
|
||||
|
||||
static void displayReverseButtonTempChangeEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled)); }
|
||||
|
||||
static void displayReverseButtonSettings(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::ReverseButtonSettings)); }
|
||||
|
||||
static void displayAnimationSpeed(void) {
|
||||
switch (getSettingValue(SettingsOptions::AnimationSpeed)) {
|
||||
case settingOffSpeed_t::SLOW:
|
||||
|
@@ -152,9 +152,9 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
if (currentVirtualPosition > 0) {
|
||||
currentVirtualPosition--;
|
||||
}
|
||||
|
||||
// The height of the indicator is screen res height / total menu entries
|
||||
uint8_t indicatorHeight = OLED_HEIGHT / *currentMenuLength;
|
||||
|
||||
if (indicatorHeight == 0) {
|
||||
indicatorHeight = 1; // always at least 1 pixel
|
||||
}
|
||||
@@ -181,8 +181,8 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
OLED::drawScrollIndicator((uint8_t)position, indicatorHeight);
|
||||
}
|
||||
}
|
||||
// Now handle user button input
|
||||
|
||||
// Now handle user button input
|
||||
auto callIncrementHandler = [&]() {
|
||||
if (currentMenu[currentScreen].incrementHandler != nullptr) {
|
||||
currentMenu[currentScreen].incrementHandler();
|
||||
@@ -192,14 +192,18 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
return false;
|
||||
};
|
||||
|
||||
//
|
||||
// Set buttons actions according to the settings
|
||||
bool swapButtonsSettings = getSettingValue(SettingsOptions::ReverseButtonSettings);
|
||||
uint8_t button_enter = swapButtonsSettings ? BUTTON_B_SHORT : BUTTON_F_SHORT;
|
||||
uint8_t button_enter_long = swapButtonsSettings ? BUTTON_B_LONG : BUTTON_F_LONG;
|
||||
uint8_t button_next = swapButtonsSettings ? BUTTON_F_SHORT : BUTTON_B_SHORT;
|
||||
uint8_t button_next_long = swapButtonsSettings ? BUTTON_F_LONG : BUTTON_B_LONG;
|
||||
|
||||
OperatingMode newMode = OperatingMode::SettingsMenu;
|
||||
switch (buttons) {
|
||||
case BUTTON_NONE:
|
||||
if (BUTTON_NONE == buttons) {
|
||||
(*autoRepeatAcceleration) = 0; // reset acceleration
|
||||
(*autoRepeatTimer) = 0; // reset acceleration
|
||||
break;
|
||||
case BUTTON_BOTH:
|
||||
} else if (BUTTON_BOTH == buttons) {
|
||||
if (*subEntry == 0) {
|
||||
saveSettings();
|
||||
cxt->transitionMode = TransitionAnimation::Left;
|
||||
@@ -209,9 +213,7 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
*subEntry = 0;
|
||||
return OperatingMode::SettingsMenu;
|
||||
}
|
||||
break;
|
||||
|
||||
case BUTTON_F_LONG:
|
||||
} else if (button_enter_long == buttons) {
|
||||
if (xTaskGetTickCount() + (*autoRepeatAcceleration) > (*autoRepeatTimer) + PRESS_ACCEL_INTERVAL_MAX) {
|
||||
callIncrementHandler();
|
||||
// Update the check for if its the last version
|
||||
@@ -229,8 +231,7 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
(*autoRepeatAcceleration) += PRESS_ACCEL_STEP;
|
||||
*currentMenuLength = 0; // Reset incase menu visible changes
|
||||
}
|
||||
break;
|
||||
case BUTTON_F_SHORT:
|
||||
} else if (button_enter == buttons) {
|
||||
// Increment setting
|
||||
if (*isRenderingHelp) {
|
||||
*isRenderingHelp = 0;
|
||||
@@ -248,24 +249,19 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
|
||||
callIncrementHandler();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BUTTON_B_LONG:
|
||||
} else if (button_next_long == buttons) {
|
||||
if (xTaskGetTickCount() + (*autoRepeatAcceleration) > (*autoRepeatTimer) + PRESS_ACCEL_INTERVAL_MAX) {
|
||||
(*autoRepeatTimer) = xTaskGetTickCount();
|
||||
(*autoRepeatAcceleration) += PRESS_ACCEL_STEP;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
/* Fall through*/
|
||||
case BUTTON_B_SHORT:
|
||||
// Increment menu item
|
||||
|
||||
newMode = moveToNextEntry(cxt);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (button_next == buttons) {
|
||||
// Increment menu item
|
||||
newMode = moveToNextEntry(cxt);
|
||||
} else {
|
||||
// default
|
||||
}
|
||||
|
||||
if ((PRESS_ACCEL_INTERVAL_MAX - (*autoRepeatAcceleration)) < PRESS_ACCEL_INTERVAL_MIN) {
|
||||
(*autoRepeatAcceleration) = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
|
||||
}
|
||||
|
Reference in New Issue
Block a user