[Feature] FS#13850 - Add SELECT button support in calculator on FiiO M3K

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Wed, 29 Apr 2026 11:30:04 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 2d419b4b93e05da0baeef405f7cf79d8184e506f
Author: William Wilgus <[email protected]>
Date:   Wed Apr 29 11:24:34 2026 -0400

    [Feature] FS#13850 - Add SELECT button support in calculator on FiiO M3K
    
    baremetal port add select as a second way to enter
    
    Change-Id: I0e3ab76fee8e6accd4425def3da48fb12a6142e8

diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index 5e69e1f12a..27bb4bb438 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -519,6 +519,7 @@ F3: equal to "="
 #define CALCULATOR_DOWN     BUTTON_DOWN
 #define CALCULATOR_QUIT     BUTTON_POWER
 #define CALCULATOR_INPUT    BUTTON_PLAY
+#define CALCULATOR_INPUT2  (BUTTON_SELECT|BUTTON_REL)
 #define CALCULATOR_CALC     BUTTON_MENU
 #define CALCULATOR_CLEAR    BUTTON_BACK
 
@@ -1938,6 +1939,9 @@ Handle buttons on basic screen
 ----------------------------------------------------------------------- */
 static void basicButtonsProcess(void){
     switch (btn) {
+#ifdef CALCULATOR_INPUT2
+        case CALCULATOR_INPUT2: /*fallthrough*/
+#endif
         case CALCULATOR_INPUT:
             if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break;
             flashButton();
@@ -2041,6 +2045,9 @@ Handle buttons on scientific screen
 ----------------------------------------------------------------------- */
 static void sciButtonsProcess(void){
     switch (btn) {
+#ifdef CALCULATOR_INPUT2
+        case CALCULATOR_INPUT2: /*fallthrough*/
+#endif
         case CALCULATOR_INPUT:
             if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break;
             flashButton();
@@ -2133,6 +2140,9 @@ static int handleButton(int button){
                 break;
             /* no unconditional break; here! */
 #endif
+#ifdef CALCULATOR_INPUT2 /* bypass pre button */
+        case CALCULATOR_INPUT2: /*fallthrough*/
+#endif
 #ifdef CALCULATOR_OPERATORS
         case CALCULATOR_OPERATORS:
 #endif
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs