[NV14] Use trim hats to emulate key events when standalone lua script running (#985)

* Preliminary trims as keys for lua
Largely based on open-flysky implementation

* Add `isLuaStandaloneRunning()`

* Add more virtual events

* Tweak virtual events further

* Finish remapping keys to virtual events

* Move some virtuals to right trim hat

* Add missing "defined"

* Revert to common EVT_VIRTUAL_MENU mapping

* Make keys/trims reset backlight like other radios
This commit is contained in:
Peter Feerick
2021-11-09 12:50:20 +11:00
committed by GitHub
parent 1bdb99f2bb
commit 3ad98bacf4
4 changed files with 49 additions and 20 deletions
+3
View File
@@ -240,6 +240,9 @@ struct LuaMemTracer {
void * tracer_alloc(void * ud, void * ptr, size_t osize, size_t nsize);
inline bool isLuaStandaloneRunning() {
return scriptInternalData[0].reference == SCRIPT_STANDALONE;
}
#else // defined(LUA)
#define luaInit()