From 3b907d739fe49927cc4adcdbc164c9c2aadb7f06 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 19 Jan 2018 10:24:02 +0100 Subject: [PATCH] - controlapi: fix control of external plugins (e.g. msgbox or shellexec) We have to send the keys directyl to rc-device instead of using g_RCInput->postMsg() Signed-off-by: Thilo Graf --- src/nhttpd/tuxboxapi/controlapi.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 419654e38..949f07837 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -56,7 +56,12 @@ extern cVideo * videoDecoder; extern CPlugins *g_Plugins;//for relodplugins extern CBouquetManager *g_bouquetManager; -#define EVENTDEV "/dev/input/input0" + +#if HAVE_COOL_HARDWARE + #define RC_DEVICE "/dev/input/nevis_ir" +#else + #define RC_DEVICE "/dev/input/event1" +#endif //----------------------------------------------------------------------------- //============================================================================= @@ -915,10 +920,10 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) if (!hh->ParamList["repeat"].empty()) repeat = atoi(hh->ParamList["repeat"].c_str()); #endif -#if 0 - int evd = open(EVENTDEV, O_RDWR); +#if 1 + int evd = open(RC_DEVICE, O_RDWR); if (evd < 0) { - perror("opening " EVENTDEV " failed"); + perror("opening " RC_DEVICE " failed"); hh->SendError(); return; } @@ -935,9 +940,10 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) return; } close(evd); -#endif +#else /* 0 == KEY_PRESSED in rcinput.cpp */ g_RCInput->postMsg((neutrino_msg_t) sendcode, 0); +#endif hh->SendOk(); } //-----------------------------------------------------------------------------