Skip to content

Commit

Permalink
keyboard mejorado
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorcelli committed Nov 29, 2024
1 parent 6e37a48 commit dfcc2b7
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ports/CYD-2432S028/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
1 change: 1 addition & 0 deletions ports/lilygo-t-deck/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build_flags =
-Iports/lilygo-t-deck
;-DCORE_DEBUG_LEVEL=5
-DBOARD_HAS_PSRAM=1
-DARDUINO_USB_CDC_ON_BOOT=1

-DT_DECK=1
-DPIN_POWER_ON=10
Expand Down
2 changes: 1 addition & 1 deletion ports/lilygo-t-display-s3-touch/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,~BGCOLOR); // Ok Rectangle
tft.drawRect(55,2,50,20,~BGCOLOR); // CAP Rectangle
Expand Down
1 change: 1 addition & 0 deletions ports/lilygo-t-display-s3-touch/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build_flags =
-Iports/lilygo-t-display-s3-touch
;-DCORE_DEBUG_LEVEL=5
-DBOARD_HAS_PSRAM=1
-DARDUINO_USB_CDC_ON_BOOT=1

-DT_DISPLAY_S3=1
-DREDRAW_DELAY=200
Expand Down
2 changes: 1 addition & 1 deletion ports/lilygo-t-embed-cc1101/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
2 changes: 2 additions & 0 deletions ports/lilygo-t-embed-cc1101/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ build_flags =
-Iports/lilygo-t-embed-cc1101
;-DCORE_DEBUG_LEVEL=5
-DBOARD_HAS_PSRAM=1
-DARDUINO_USB_CDC_ON_BOOT=1

-DT_EMBED=1
-DPIN_POWER_ON=46
Expand Down Expand Up @@ -110,6 +111,7 @@ build_flags =
-Iports/lilygo-t-embed-cc1101
;-DCORE_DEBUG_LEVEL=5
-DBOARD_HAS_PSRAM=1
-DARDUINO_USB_CDC_ON_BOOT=1

-DT_EMBED=1
-DT_EMBED_1101=1
Expand Down
1 change: 1 addition & 0 deletions ports/m5stack-cardputer/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build_flags =
${env.build_flags}
-Iports/m5stack-cardputer
-DCORE_DEBUG_LEVEL=5
-DARDUINO_USB_CDC_ON_BOOT=1
-DCARDPUTER=1
-DREDRAW_DELAY=200

Expand Down
2 changes: 1 addition & 1 deletion ports/m5stack-core/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
2 changes: 1 addition & 1 deletion ports/m5stack-core2/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
2 changes: 1 addition & 1 deletion ports/m5stack-cores3/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
1 change: 1 addition & 0 deletions ports/m5stack-cores3/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ build_flags =
-Iports/m5stack-cores3
;-DCORE_DEBUG_LEVEL=5
-DBOARD_HAS_PSRAM
-DARDUINO_USB_CDC_ON_BOOT=1

-DCORE3=1
-DREDRAW_DELAY=200
Expand Down
2 changes: 1 addition & 1 deletion ports/m5stack-cplus1_1/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
2 changes: 1 addition & 1 deletion ports/m5stack-cplus2/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand Down
22 changes: 11 additions & 11 deletions ports/marauder-mini/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,TFT_WHITE); // Ok Rectangle
tft.drawRect(55,2,50,20,TFT_WHITE); // CAP Rectangle
Expand All @@ -244,24 +244,24 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.drawRect(3,32,WIDTH-3,20,FGCOLOR); // mystring Rectangle


if(x==0 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(7,2,50,20,TFT_WHITE); }
else tft.setTextColor(TFT_WHITE, BGCOLOR);
tft.drawString("OK", 18, 4);
if(x==0 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(7,2,24,20,TFT_WHITE); }
else tft.setTextColor(TFT_WHITE, BGCOLOR);
tft.drawString("OK", 9, 4);


if(x==1 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(55,2,50,20,TFT_WHITE); }
else if(caps) { tft.fillRect(55,2,50,20,TFT_DARKGREY); tft.setTextColor(TFT_WHITE, TFT_DARKGREY); }
if(x==1 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(33,2,24,20,TFT_WHITE); }
else if(caps) { tft.fillRect(33,2,24,20,TFT_DARKGREY); tft.setTextColor(TFT_WHITE, TFT_DARKGREY); }
else tft.setTextColor(TFT_WHITE, BGCOLOR);
tft.drawString("CAP", 64, 4);
tft.drawString("CAP", 35, 4);


if(x==2 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(107,2,50,20,TFT_WHITE); }
if(x==2 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(59,2,24,20,TFT_WHITE); }
else tft.setTextColor(TFT_WHITE, BGCOLOR);
tft.drawString("DEL", 115, 4);
tft.drawString("DEL", 61, 4);

if(x>2 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(159,2,74,20,TFT_WHITE); }
if(x>2 && y==-1) { tft.setTextColor(BGCOLOR, TFT_WHITE); tft.fillRect(85,2,36,20,TFT_WHITE); }
else tft.setTextColor(TFT_WHITE, BGCOLOR);
tft.drawString("SPACE", 168, 4);
tft.drawString("SPACE", 87, 4);
}

tft.setTextSize(FP);
Expand Down
2 changes: 1 addition & 1 deletion ports/marauder-v4og/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ String keyboard(String mytext, int maxSize, String msg) {
tft.setTextSize(FM);

//Draw the rectangles
if(y<0) {
if(y<0 || y2<0) {
tft.fillRect(0,1,WIDTH,22,BGCOLOR);
tft.drawRect(7,2,46,20,~BGCOLOR); // Ok Rectangle
tft.drawRect(55,2,50,20,~BGCOLOR); // CAP Rectangle
Expand Down
8 changes: 5 additions & 3 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ void drawMainMenu(int index) {

setTftDisplay(-1, -1, FGCOLOR, 1, BGCOLOR);

#if WIDTH<200
tft.drawCentreString(messages[index], WIDTH / 2, 18, 1);
#if WIDTH<125
tft.drawCentreString(messages[index], WIDTH / 2, 26, 1);
#else
tft.drawCentreString(messages[index], WIDTH / 2, HEIGHT - 25, 1);
#endif
Expand Down Expand Up @@ -517,8 +517,10 @@ void drawBatteryStatus() {
tft.drawRoundRect(WIDTH - 42, 7, 34, 17, 2, FGCOLOR);
int bat = getBattery();
tft.setTextSize(FONT_P);
tft.setTextColor(FGCOLOR, BGCOLOR);
tft.setTextColor(FGCOLOR, BGCOLOR);
#if WIDTH>140 // Excludes Marauder Mini
tft.drawRightString(" " + String(bat) + "%", WIDTH - 45, 12, 1);
#endif
tft.fillRoundRect(WIDTH - 40, 9, 30, 13, 2, BGCOLOR);
tft.fillRoundRect(WIDTH - 40, 9, 30 * bat / 100, 13, 2, FGCOLOR);
tft.drawLine(WIDTH - 30, 9, WIDTH - 30, 9 + 13, BGCOLOR);
Expand Down

0 comments on commit dfcc2b7

Please sign in to comment.