Skip to content

Commit 405a555

Browse files
committed
Implemented Fields Change with touch screen
1 parent 4825ccf commit 405a555

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

examples/I2C_menu/I2C_menu.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ void setup()
4141

4242
void loop()
4343
{
44-
//serial can use numbers or +/- and Enter to navigate
44+
//serial can use numbers or +/- and Enter=* Esc=/ to navigate (nav keys can be redefined)
4545
mainMenu.poll(menu_lcd,Serial);
4646
}

examples/LCD_menu/LCD_menu.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ quadEncoder quadEncoder(encA,encB);//simple quad encoder driver
7575
quadEncoderStream enc(quadEncoder,5);// simple quad encoder fake Stream
7676

7777
//a keyboard with only one key :D, this is the encoder button
78-
keyMap encBtn_map[]={{-encBtn,13}};//negative pin numbers means we have a pull-up, this is on when low
78+
keyMap encBtn_map[]={{-encBtn,menu::enterCode}};//negative pin numbers means we have a pull-up, this is on when low
7979
keyLook<1> encButton(encBtn_map);
8080

8181
//multiple inputs allow conjugation of the quadEncoder with a single key keyboard that is the quadEncoder button

examples/gfx_menu/gfx_menu.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ quadEncoder encoder(encA,encB);//simple quad encoder driver
8989
quadEncoderStream enc(encoder,5);// simple quad encoder fake Stream
9090

9191
//a keyboard with only one key :D, this is the encoder button
92-
keyMap encBtn_map[]={{-encBtn,13}};//negative pin numbers means we have a pull-up, this is on when low
92+
keyMap encBtn_map[]={{-encBtn,menu::enterCode}};//negative pin numbers means we have a pull-up, this is on when low
9393
keyLook<1> encButton(encBtn_map);
9494

9595
//multiple inputs allow conjugation of the quadEncoder with a single key keyboard that is the quadEncoder button

menu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ www.r-site.net
215215
virtual void activate(menuOut& p,Stream&c,bool) {
216216
action(*this,p,c);
217217
}
218+
virtual bool isMenu() const {return false;}
218219
};
219220

220221
class menuNode:public prompt {//some basic information for menus and fields
@@ -253,6 +254,7 @@ www.r-site.net
253254

254255
void poll(menuOut& p,Stream& c,bool canExit=false);
255256

257+
virtual bool isMenu() const {return true;}
256258
};
257259

258260
#endif

menuFields.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ www.r-site.net
4040
};
4141

4242
//Prompt linked to a variable
43+
//TODO: implement Escape on a field cancels the editting (undo) restoring the value
4344
static const char* numericChars="0123456789.";
4445
template <typename T>
4546
class menuField:public menuNode {

0 commit comments

Comments
 (0)