diff --git a/proto/config.proto b/proto/config.proto index 05511c0a1..caaa13a9c 100644 --- a/proto/config.proto +++ b/proto/config.proto @@ -53,6 +53,19 @@ message KeyboardMapping optional uint32 keyButtonA2 = 18; optional uint32 keyButtonA3 = 19; optional uint32 keyButtonA4 = 20; + optional uint32 keyButtonE1 = 21; + optional uint32 keyButtonE2 = 22; + optional uint32 keyButtonE3 = 23; + optional uint32 keyButtonE4 = 24; + optional uint32 keyButtonE5 = 25; + optional uint32 keyButtonE6 = 26; + optional uint32 keyButtonE7 = 27; + optional uint32 keyButtonE8 = 28; + optional uint32 keyButtonE9 = 29; + optional uint32 keyButtonE10 = 30; + optional uint32 keyButtonE11 = 31; + optional uint32 keyButtonE12 = 32; + } message HotkeyEntry diff --git a/src/configs/webconfig.cpp b/src/configs/webconfig.cpp index c10578b6f..3a36895bc 100644 --- a/src/configs/webconfig.cpp +++ b/src/configs/webconfig.cpp @@ -1133,6 +1133,18 @@ std::string setKeyMappings() readDoc(keyboardMapping.keyButtonA2, doc, "A2"); readDoc(keyboardMapping.keyButtonA3, doc, "A3"); readDoc(keyboardMapping.keyButtonA4, doc, "A4"); + readDoc(keyboardMapping.keyButtonE1, doc, "E1"); + readDoc(keyboardMapping.keyButtonE2, doc, "E2"); + readDoc(keyboardMapping.keyButtonE3, doc, "E3"); + readDoc(keyboardMapping.keyButtonE4, doc, "E4"); + readDoc(keyboardMapping.keyButtonE5, doc, "E5"); + readDoc(keyboardMapping.keyButtonE6, doc, "E6"); + readDoc(keyboardMapping.keyButtonE7, doc, "E7"); + readDoc(keyboardMapping.keyButtonE8, doc, "E8"); + readDoc(keyboardMapping.keyButtonE9, doc, "E9"); + readDoc(keyboardMapping.keyButtonE10, doc, "E10"); + readDoc(keyboardMapping.keyButtonE11, doc, "E11"); + readDoc(keyboardMapping.keyButtonE12, doc, "E12"); Storage::getInstance().save(); @@ -1164,7 +1176,19 @@ std::string getKeyMappings() writeDoc(doc, "A2", keyboardMapping.keyButtonA2); writeDoc(doc, "A3", keyboardMapping.keyButtonA3); writeDoc(doc, "A4", keyboardMapping.keyButtonA4); - + writeDoc(doc, "E1", keyboardMapping.keyButtonE1); + writeDoc(doc, "E2", keyboardMapping.keyButtonE2); + writeDoc(doc, "E3", keyboardMapping.keyButtonE3); + writeDoc(doc, "E4", keyboardMapping.keyButtonE4); + writeDoc(doc, "E5", keyboardMapping.keyButtonE5); + writeDoc(doc, "E6", keyboardMapping.keyButtonE6); + writeDoc(doc, "E7", keyboardMapping.keyButtonE7); + writeDoc(doc, "E8", keyboardMapping.keyButtonE8); + writeDoc(doc, "E9", keyboardMapping.keyButtonE9); + writeDoc(doc, "E10", keyboardMapping.keyButtonE10); + writeDoc(doc, "E11", keyboardMapping.keyButtonE11); + writeDoc(doc, "E12", keyboardMapping.keyButtonE12); + return serialize_json(doc); } diff --git a/src/drivers/keyboard/KeyboardDriver.cpp b/src/drivers/keyboard/KeyboardDriver.cpp index ccc39b283..47539fa15 100644 --- a/src/drivers/keyboard/KeyboardDriver.cpp +++ b/src/drivers/keyboard/KeyboardDriver.cpp @@ -72,6 +72,18 @@ void KeyboardDriver::process(Gamepad * gamepad) { if(gamepad->pressedR3()) { pressKey(keyboardMapping.keyButtonR3); } if(gamepad->pressedA1()) { pressKey(keyboardMapping.keyButtonA1); } if(gamepad->pressedA2()) { pressKey(keyboardMapping.keyButtonA2); } + if(gamepad->pressedE1()) { pressKey(keyboardMapping.keyButtonE1); } + if(gamepad->pressedE2()) { pressKey(keyboardMapping.keyButtonE2); } + if(gamepad->pressedE3()) { pressKey(keyboardMapping.keyButtonE3); } + if(gamepad->pressedE4()) { pressKey(keyboardMapping.keyButtonE4); } + if(gamepad->pressedE5()) { pressKey(keyboardMapping.keyButtonE5); } + if(gamepad->pressedE6()) { pressKey(keyboardMapping.keyButtonE6); } + if(gamepad->pressedE7()) { pressKey(keyboardMapping.keyButtonE7); } + if(gamepad->pressedE8()) { pressKey(keyboardMapping.keyButtonE8); } + if(gamepad->pressedE9()) { pressKey(keyboardMapping.keyButtonE9); } + if(gamepad->pressedE10()) { pressKey(keyboardMapping.keyButtonE10); } + if(gamepad->pressedE11()) { pressKey(keyboardMapping.keyButtonE11); } + if(gamepad->pressedE12()) { pressKey(keyboardMapping.keyButtonE12); } // Wake up TinyUSB device if (tud_suspended())