Skip to content

Commit faa9d31

Browse files
committed
Version 0.9.13
!IMPORTANT, make sure to also update the EPS32-BLE-Keyboard library for some of these changes to work. !ALSO IMPORTANT to use the added keys in the configurator you will have to re-upload the data folder. This will overwrite your configs, so make sure to download them first! Fix: Issue #54 Not all filenames are allowed for uploading. Fix: Increase the size of DynamicJsonDocument to 1500 to support larger configs Fix in ESP32-BLE-Keyboard: Changed to 115 keys (for F13-F24), added NUMPAD keys Added: NUMPAD keys to configurator and Action.h (action 12) Added: PrintScreen, HOME, END, and ESCAPE to Action.h and configurator
1 parent a3cd15e commit faa9d31

File tree

5 files changed

+169
-31
lines changed

5 files changed

+169
-31
lines changed

Action.h

+66
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ void bleKeyboardAction(int action, int value, char *symbol)
5959
case 10:
6060
bleKeyboard.write(KEY_DELETE);
6161
break;
62+
case 11:
63+
bleKeyboard.write(KEY_PRTSC);
64+
break;
65+
case 12:
66+
bleKeyboard.write(KEY_ESC);
67+
break;
68+
case 13:
69+
bleKeyboard.write(KEY_HOME);
70+
break;
71+
case 14:
72+
bleKeyboard.write(KEY_END);
73+
break;
74+
6275
default:
6376
//if nothing matches do nothing
6477
break;
@@ -478,6 +491,59 @@ void bleKeyboardAction(int action, int value, char *symbol)
478491
break;
479492
}
480493
break;
494+
case 12: // Numpad
495+
switch (value)
496+
{
497+
case 0:
498+
bleKeyboard.write(NUM_0);
499+
break;
500+
case 1:
501+
bleKeyboard.write(NUM_1);
502+
break;
503+
case 2:
504+
bleKeyboard.write(NUM_2);
505+
break;
506+
case 3:
507+
bleKeyboard.write(NUM_3);
508+
break;
509+
case 4:
510+
bleKeyboard.write(NUM_4);
511+
break;
512+
case 5:
513+
bleKeyboard.write(NUM_5);
514+
break;
515+
case 6:
516+
bleKeyboard.write(NUM_6);
517+
break;
518+
case 7:
519+
bleKeyboard.write(NUM_7);
520+
break;
521+
case 8:
522+
bleKeyboard.write(NUM_8);
523+
break;
524+
case 9:
525+
bleKeyboard.write(NUM_9);
526+
break;
527+
case 10:
528+
bleKeyboard.write(NUM_SLASH);
529+
break;
530+
case 11:
531+
bleKeyboard.write(NUM_ASTERIX);
532+
break;
533+
case 12:
534+
bleKeyboard.write(NUM_MINUS);
535+
break;
536+
case 13:
537+
bleKeyboard.write(NUM_PLUS);
538+
break;
539+
case 14:
540+
bleKeyboard.write(NUM_ENTER);
541+
break;
542+
case 15:
543+
bleKeyboard.write(NUM_PERIOD);
544+
break;
545+
}
546+
break;
481547
default:
482548
//If nothing matches do nothing
483549
break;

ConfigLoad.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool loadConfig(String value)
188188
{
189189
File configfile = FILESYSTEM.open("/config/menu1.json", "r");
190190

191-
DynamicJsonDocument doc(1200);
191+
DynamicJsonDocument doc(1500);
192192

193193
DeserializationError error = deserializeJson(doc, configfile);
194194

@@ -490,7 +490,7 @@ bool loadConfig(String value)
490490
{
491491
File configfile = FILESYSTEM.open("/config/menu2.json", "r");
492492

493-
DynamicJsonDocument doc(1200);
493+
DynamicJsonDocument doc(1500);
494494

495495
DeserializationError error = deserializeJson(doc, configfile);
496496

@@ -792,7 +792,7 @@ bool loadConfig(String value)
792792
{
793793
File configfile = FILESYSTEM.open("/config/menu3.json", "r");
794794

795-
DynamicJsonDocument doc(1200);
795+
DynamicJsonDocument doc(1500);
796796

797797
DeserializationError error = deserializeJson(doc, configfile);
798798

@@ -1092,7 +1092,7 @@ bool loadConfig(String value)
10921092
{
10931093
File configfile = FILESYSTEM.open("/config/menu4.json", "r");
10941094

1095-
DynamicJsonDocument doc(1200);
1095+
DynamicJsonDocument doc(1500);
10961096

10971097
DeserializationError error = deserializeJson(doc, configfile);
10981098

@@ -1394,7 +1394,7 @@ bool loadConfig(String value)
13941394
{
13951395
File configfile = FILESYSTEM.open("/config/menu5.json", "r");
13961396

1397-
DynamicJsonDocument doc(1200);
1397+
DynamicJsonDocument doc(1500);
13981398

13991399
DeserializationError error = deserializeJson(doc, configfile);
14001400

FreeTouchDeck.ino

+10-24
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
// ------- Uncomment the next line if you use capacitive touch -------
4242
// (THE ESP32 TOUCHDOWN USES THIS!)
43-
//#define USECAPTOUCH
43+
#define USECAPTOUCH
4444

4545
// ------- Uncomment and populate the following if your cap touch uses custom i2c pins -------
4646
//#define CUSTOM_TOUCH_SDA 26
@@ -55,35 +55,21 @@
5555
#define touchInterruptPin GPIO_NUM_27
5656

5757
// ------- Uncomment the define below if you want to use a piezo buzzer and specify the pin where the speaker is connected -------
58-
//#define speakerPin 26
58+
#define speakerPin 26
5959

60-
const char *versionnumber = "0.9.11";
60+
const char *versionnumber = "0.9.13";
6161

62-
/* Version 0.9.11.
62+
/* Version 0.9.13.
6363
*
64-
* Fix: F21 in the configurator was F22 as action and F22 was missing from configurator.
65-
* Fix: "[WARNING]: SPIFFS initialisation failed!" is now "[ERROR]: SPIFFS initialisation failed!"
66-
* Fix: "Back home" and "Settings" buttons now also draw custom logos correctly.
67-
* Fix: Some function descriptions and general typos.
68-
* Fix: default.json was ignored by .gitignore and therefore not previously uploaded.
64+
* Fix: Issue #54 Not all filenames are allowed for uploading.
65+
* Fix: Increase the size of DynamicJsonDocument to 1500 to support larger configs
66+
* Fix in ESP32-BLE-Keyboard: Changed to 115 keys (for F13-F24), added NUMPAD keys
6967
*
70-
* Change: Moved TFT init before SPIFFS init, so we can draw an error message on screen if SPIFFS
71-
* init fails.
72-
* Change: Moved to a wificonfig.json just for wifi settings and a general.json for all other general
73-
* config.
68+
* Added: NUMPAD keys to configurator and Action.h (action 12)
69+
* Added: PrintScreen, HOME, END, and ESCAPE to Action.h and configurator
70+
*
7471
*
75-
* Added: Helpers are configurable so that it only takes 1 action. Case 10 Action.h.
76-
* Settings for this added to "Settings" in the configurator
77-
* Added: . (full stop) , (comma) and - (minus) added to the configurator under "Special chars"
78-
*
7972
*
80-
* Important! This version changes json structure and HTML files. Config/data files changed:
81-
*
82-
* - wificonfig.json (there are some settings added)
83-
* - general.json (colors, sleep, and beep are moved here)
84-
* - index.html
85-
*
86-
* Make sure to check if you use your old config files that they match the structure of the new ones!
8773
*/
8874

8975
#include <pgmspace.h> // PROGMEM support header

Webserver.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ String processor(const String &var)
220220
*/
221221
void handleJSONUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final)
222222
{
223-
if (filename != "menu1.json" && filename != "menu2.json" && filename != "menu3.json" && filename != "menu4.json" && filename != "menu5.json" && filename != "colors.json" && filename != "homescreen.json")
223+
if (filename != "menu1.json" && filename != "menu2.json" && filename != "menu3.json" && filename != "menu4.json" && filename != "menu5.json" && filename != "general.json" && filename != "homescreen.json" && filename != "wificonfig.json")
224224
{
225225
Serial.printf("[INFO]: JSON has invalid name: %s\n", filename.c_str());
226226
errorCode = "102";
227227
errorText = "JSON file has an invalid name. You can only upload JSON files with the following file names:";
228228
errorText += "<ul><li>menu1.json</li><li>menu2.json</li><li>menu3.json</li><li>menu4.json</li><li>menu5.json</li>";
229-
errorText += "<li>colors.json</li><li>homescreen.json</li></ul>";
229+
errorText += "<li>general.json</li><li>homescreen.json</li><li>wificonfig.json</li></ul>";
230230
request->send(FILESYSTEM, "/error.htm", String(), false, processor);
231231
return;
232232
}

data/index.htm

+86
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,22 @@ <h3>About FreeTouchDeck</h3>
10891089
{
10901090
name: 'Delete',
10911091
value: '10'
1092+
},
1093+
{
1094+
name: 'PrintScreen',
1095+
value: '11'
1096+
},
1097+
{
1098+
name: 'ESC',
1099+
value: '12'
1100+
},
1101+
{
1102+
name: 'HOME',
1103+
value: '13'
1104+
},
1105+
{
1106+
name: 'END',
1107+
value: '14'
10921108
}
10931109
]
10941110
},
@@ -1594,6 +1610,76 @@ <h3>About FreeTouchDeck</h3>
15941610
value: '11'
15951611
}
15961612

1613+
]
1614+
},
1615+
{
1616+
name: 'Numpad',
1617+
value: '12',
1618+
subitems: [{
1619+
name: 'Numpad 0',
1620+
value: '0'
1621+
},
1622+
{
1623+
name: 'Numpad 1',
1624+
value: '1'
1625+
},
1626+
{
1627+
name: 'Numpad 2',
1628+
value: '2'
1629+
},
1630+
{
1631+
name: 'Numpad 3',
1632+
value: '3'
1633+
},
1634+
{
1635+
name: 'Numpad 4',
1636+
value: '4'
1637+
},
1638+
{
1639+
name: 'Numpad 5',
1640+
value: '5'
1641+
},
1642+
{
1643+
name: 'Numpad 6',
1644+
value: '6'
1645+
},
1646+
{
1647+
name: 'Numpad 7',
1648+
value: '7'
1649+
},
1650+
{
1651+
name: 'Numpad 8',
1652+
value: '8'
1653+
},
1654+
{
1655+
name: 'Numpad 9',
1656+
value: '9'
1657+
},
1658+
{
1659+
name: 'Numpad /',
1660+
value: '10'
1661+
},
1662+
{
1663+
name: 'Numpad *',
1664+
value: '11'
1665+
},
1666+
{
1667+
name: 'Numpad -',
1668+
value: '12'
1669+
},
1670+
{
1671+
name: 'Numpad +',
1672+
value: '13'
1673+
},
1674+
{
1675+
name: 'Numpad RETURN',
1676+
value: '14'
1677+
},
1678+
{
1679+
name: 'Numpad .',
1680+
value: '15'
1681+
}
1682+
15971683
]
15981684
}
15991685
];

0 commit comments

Comments
 (0)