mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
rcinput: try to fix some key handlings
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8056fa8688
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-06-11 (Sun, 11 Jun 2023)
Origin message was:
------------------
- rcinput: try to fix some key handlings
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1780,15 +1780,15 @@ int CRCInput::translate(int code)
|
||||
case KEY_CHANNELDOWN:
|
||||
return RC_page_down;
|
||||
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7 || BOXMODEL_E4HDULTRA || BOXMODEL_PROTEK4K || BOXMODEL_HD60 || BOXMODEL_HD61 || BOXMODEL_MULTIBOX || BOXMODEL_MULTIBOXSE
|
||||
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7 || BOXMODEL_HD60 || BOXMODEL_HD61 || BOXMODEL_MULTIBOX || BOXMODEL_MULTIBOXSE
|
||||
case KEY_VIDEO:
|
||||
return RC_favorites;
|
||||
case KEY_TV2:
|
||||
return RC_tv;
|
||||
#elif BOXMODEL_OSMIO4K || BOXMODEL_OSMIO4KPLUS
|
||||
case KEY_VIDEO:
|
||||
return RC_mode;
|
||||
#endif
|
||||
case KEY_TV2:
|
||||
return RC_tv;
|
||||
case KEY_SWITCHVIDEOMODE:
|
||||
return RC_mode;
|
||||
case KEY_FASTFORWARD:
|
||||
@@ -1805,6 +1805,44 @@ int CRCInput::translate(int code)
|
||||
return (int)RC_nokey;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* revert the transformations above - used by controlapi
|
||||
*
|
||||
**************************************************************************/
|
||||
int CRCInput::translate_revert(int code)
|
||||
{
|
||||
switch(code)
|
||||
{
|
||||
case RC_home:
|
||||
return KEY_EXIT;
|
||||
case RC_page_up:
|
||||
return KEY_CHANNELUP;
|
||||
case RC_page_down:
|
||||
return KEY_CHANNELDOWN;
|
||||
#ifdef HAVE_ARM_HARDWARE
|
||||
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7 || BOXMODEL_HD60 || BOXMODEL_HD61 || BOXMODEL_MULTIBOX || BOXMODEL_MULTIBOXSE
|
||||
case RC_favorites:
|
||||
return KEY_VIDEO;
|
||||
#elif BOXMODEL_OSMIO4K || BOXMODEL_OSMIO4KPLUS
|
||||
case RC_mode:
|
||||
return KEY_VIDEO;
|
||||
#endif
|
||||
case RC_tv:
|
||||
return KEY_TV2;
|
||||
case RC_mode:
|
||||
return KEY_SWITCHVIDEOMODE;
|
||||
case RC_forward:
|
||||
return KEY_FASTFORWARD;
|
||||
case RC_play:
|
||||
case RC_pause:
|
||||
return KEY_PLAYPAUSE;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
void CRCInput::setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms)
|
||||
{
|
||||
if (start_ms == 0 && repeat_ms == 0) {
|
||||
|
@@ -100,6 +100,7 @@ class CRCInput
|
||||
bool checkdev();
|
||||
void close();
|
||||
int translate(int code);
|
||||
int translate_revert(int code);
|
||||
void calculateMaxFd(void);
|
||||
int checkTimers();
|
||||
bool mayRepeat(uint32_t key, bool bAllowRepeatLR = false);
|
||||
@@ -239,7 +240,6 @@ class CRCInput
|
||||
CRCInput(); //constructor - opens rc-device and starts needed threads
|
||||
~CRCInput(); //destructor - closes rc-device
|
||||
|
||||
|
||||
static bool isNumeric(const neutrino_msg_t key);
|
||||
static int getNumericValue(const neutrino_msg_t key);
|
||||
static unsigned int convertDigitToKey(const unsigned int digit);
|
||||
@@ -268,6 +268,7 @@ class CRCInput
|
||||
|
||||
int messageLoop(bool anyKeyCancels = false, int timeout = -1);
|
||||
|
||||
int translateRevert(int c) { return translate_revert(c); };
|
||||
void setLongPressAny(bool b) { longPressAny = b; };
|
||||
void setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms);
|
||||
};
|
||||
|
@@ -963,34 +963,6 @@ void CControlAPI::RestartCGI(CyhookHandler *hh)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
unsigned int revert_translate(unsigned int code)
|
||||
{
|
||||
switch(code)
|
||||
{
|
||||
case RC_home:
|
||||
return KEY_EXIT;
|
||||
case RC_page_up:
|
||||
return KEY_CHANNELUP;
|
||||
case RC_page_down:
|
||||
return KEY_CHANNELDOWN;
|
||||
#ifdef HAVE_ARM_HARDWARE
|
||||
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7 || BOXMODEL_HD60 || BOXMODEL_HD61 || BOXMODEL_MULTIBOX || BOXMODEL_MULTIBOXSE || BOXMODEL_OSMIO4K || BOXMODEL_OSMIO4KPLUS
|
||||
case RC_favorites:
|
||||
return KEY_VIDEO;
|
||||
#endif
|
||||
case RC_mode:
|
||||
return KEY_SWITCHVIDEOMODE;
|
||||
case RC_play:
|
||||
case RC_pause:
|
||||
return KEY_PLAYPAUSE;
|
||||
case RC_forward:
|
||||
return KEY_FASTFORWARD;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
void CControlAPI::rc_sync(int fd)
|
||||
{
|
||||
@@ -1053,7 +1025,7 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh)
|
||||
hh->SendError();
|
||||
return;
|
||||
}
|
||||
sendcode = revert_translate(sendcode);
|
||||
sendcode = g_RCInput->translateRevert(sendcode);
|
||||
if (rc_send(evd, sendcode, KEY_PRESSED) < 0) {
|
||||
perror("writing 'KEY_PRESSED' event failed");
|
||||
hh->SendError();
|
||||
|
Reference in New Issue
Block a user