From f24301c5797a7024f62111d0f6fd58407de3d92b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 22 Jan 2018 23:17:34 +0100 Subject: [PATCH] add revert translate to webif rc Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f336d4b4718dbf1b5c85beeb8499fd8915f62a3b Author: Jacek Jendrzej Date: 2018-01-22 (Mon, 22 Jan 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 0b1e7cc79..9d65dd63e 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -890,6 +890,36 @@ void CControlAPI::RebootCGI(CyhookHandler *hh) } //----------------------------------------------------------------------------- +unsigned int revert_translate(unsigned int code) +{ + switch(code) + { + case RC_play: + return KEY_PLAYPAUSE; + case RC_page_up: + return KEY_CHANNELUP; + case RC_page_down: + return KEY_CHANNELDOWN; +#ifdef HAVE_ARM_HARDWARE + case RC_favorites: + return KEY_VIDEO; +#endif +#ifdef HAVE_AZBOX_HARDWARE + case RC_favorites: + return KEY_HOME; + case RC_stop: + return KEY_TV; + case RC_record: + return KEY_RADIO; + case RC_pause: + return KEY_PLAY; +#endif + default: + break; + } + return code; + +} void dev_uinput_sync(int fd) { struct input_event ev; @@ -948,6 +978,7 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) hh->SendError(); return; } + sendcode = revert_translate(sendcode); if (rc_send(evd, sendcode, KEY_PRESSED) < 0) { perror("writing 'KEY_PRESSED' event failed"); hh->SendError();