mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
rcinput: try to fix some key handlings
This commit is contained in:
@@ -1778,15 +1778,15 @@ int CRCInput::translate(int code)
|
|||||||
case KEY_CHANNELDOWN:
|
case KEY_CHANNELDOWN:
|
||||||
return RC_page_down;
|
return RC_page_down;
|
||||||
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
#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:
|
case KEY_VIDEO:
|
||||||
return RC_favorites;
|
return RC_favorites;
|
||||||
case KEY_TV2:
|
|
||||||
return RC_tv;
|
|
||||||
#elif BOXMODEL_OSMIO4K || BOXMODEL_OSMIO4KPLUS
|
#elif BOXMODEL_OSMIO4K || BOXMODEL_OSMIO4KPLUS
|
||||||
case KEY_VIDEO:
|
case KEY_VIDEO:
|
||||||
return RC_mode;
|
return RC_mode;
|
||||||
#endif
|
#endif
|
||||||
|
case KEY_TV2:
|
||||||
|
return RC_tv;
|
||||||
case KEY_SWITCHVIDEOMODE:
|
case KEY_SWITCHVIDEOMODE:
|
||||||
return RC_mode;
|
return RC_mode;
|
||||||
case KEY_FASTFORWARD:
|
case KEY_FASTFORWARD:
|
||||||
@@ -1803,6 +1803,44 @@ int CRCInput::translate(int code)
|
|||||||
return (int)RC_nokey;
|
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)
|
void CRCInput::setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms)
|
||||||
{
|
{
|
||||||
/* iterate backwards or the vector will be corrupted by the indev.erase(i) */
|
/* iterate backwards or the vector will be corrupted by the indev.erase(i) */
|
||||||
|
@@ -100,6 +100,7 @@ class CRCInput
|
|||||||
bool checkdev();
|
bool checkdev();
|
||||||
void close();
|
void close();
|
||||||
int translate(int code);
|
int translate(int code);
|
||||||
|
int translate_revert(int code);
|
||||||
void calculateMaxFd(void);
|
void calculateMaxFd(void);
|
||||||
int checkTimers();
|
int checkTimers();
|
||||||
bool mayRepeat(uint32_t key, bool bAllowRepeatLR = false);
|
bool mayRepeat(uint32_t key, bool bAllowRepeatLR = false);
|
||||||
@@ -239,7 +240,6 @@ class CRCInput
|
|||||||
CRCInput(); //constructor - opens rc-device and starts needed threads
|
CRCInput(); //constructor - opens rc-device and starts needed threads
|
||||||
~CRCInput(); //destructor - closes rc-device
|
~CRCInput(); //destructor - closes rc-device
|
||||||
|
|
||||||
|
|
||||||
static bool isNumeric(const neutrino_msg_t key);
|
static bool isNumeric(const neutrino_msg_t key);
|
||||||
static int getNumericValue(const neutrino_msg_t key);
|
static int getNumericValue(const neutrino_msg_t key);
|
||||||
static unsigned int convertDigitToKey(const unsigned int digit);
|
static unsigned int convertDigitToKey(const unsigned int digit);
|
||||||
@@ -268,6 +268,7 @@ class CRCInput
|
|||||||
|
|
||||||
int messageLoop(bool anyKeyCancels = false, int timeout = -1);
|
int messageLoop(bool anyKeyCancels = false, int timeout = -1);
|
||||||
|
|
||||||
|
int translateRevert(int c) { return translate_revert(c); };
|
||||||
void setLongPressAny(bool b) { longPressAny = b; };
|
void setLongPressAny(bool b) { longPressAny = b; };
|
||||||
void setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms);
|
void setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms);
|
||||||
};
|
};
|
||||||
|
@@ -954,34 +954,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)
|
void CControlAPI::rc_sync(int fd)
|
||||||
{
|
{
|
||||||
@@ -1044,7 +1016,7 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh)
|
|||||||
hh->SendError();
|
hh->SendError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendcode = revert_translate(sendcode);
|
sendcode = g_RCInput->translateRevert(sendcode);
|
||||||
if (rc_send(evd, sendcode, KEY_PRESSED) < 0) {
|
if (rc_send(evd, sendcode, KEY_PRESSED) < 0) {
|
||||||
perror("writing 'KEY_PRESSED' event failed");
|
perror("writing 'KEY_PRESSED' event failed");
|
||||||
hh->SendError();
|
hh->SendError();
|
||||||
|
Reference in New Issue
Block a user