summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rockaux.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rockaux.c')
-rw-r--r--apps/plugins/lua/rockaux.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/plugins/lua/rockaux.c b/apps/plugins/lua/rockaux.c
index 562d1654a7..734b6a8324 100644
--- a/apps/plugins/lua/rockaux.c
+++ b/apps/plugins/lua/rockaux.c
@@ -24,6 +24,7 @@
24#include "plugin.h" 24#include "plugin.h"
25#define _ROCKCONF_H_ /* Protect against unwanted include */ 25#define _ROCKCONF_H_ /* Protect against unwanted include */
26#include "lua.h" 26#include "lua.h"
27#include "lib/pluginlib_actions.h"
27 28
28extern long strtol(const char *nptr, char **endptr, int base); 29extern long strtol(const char *nptr, char **endptr, int base);
29 30
@@ -164,3 +165,21 @@ int filetol(int fd, long *num)
164 return retn; 165 return retn;
165} 166}
166 167
168int get_plugin_action(int timeout, bool with_remote)
169{
170 static const struct button_mapping *m1[] = { pla_main_ctx };
171 int btn;
172
173#ifndef HAVE_REMOTE_LCD
174 (void) with_remote;
175#else
176 static const struct button_mapping *m2[] = { pla_main_ctx, pla_remote_ctx };
177
178 if (with_remote)
179 btn = pluginlib_getaction(timeout, m2, 2);
180 else
181#endif
182 btn = pluginlib_getaction(timeout, m1, 1);
183
184 return btn;
185}