mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
rcinput: add hack to set rcdelay after device hotplug
this fixes e.g. wrong repeat settings after lircd restart
Origin commit data
------------------
Branch: ni/coolstream
Commit: ed5be5143b
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-09-06 (Wed, 06 Sep 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -75,6 +75,9 @@ static bool saved_orig_termio = false;
|
|||||||
static bool input_stopped = false;
|
static bool input_stopped = false;
|
||||||
static struct timespec devinput_mtime = { 0, 0 };
|
static struct timespec devinput_mtime = { 0, 0 };
|
||||||
|
|
||||||
|
static unsigned int _start_ms = 0;
|
||||||
|
static unsigned int _repeat_ms = 0;
|
||||||
|
|
||||||
#ifdef RCDEBUG
|
#ifdef RCDEBUG
|
||||||
#define d_printf printf
|
#define d_printf printf
|
||||||
#else
|
#else
|
||||||
@@ -243,6 +246,7 @@ void CRCInput::open(bool recheck)
|
|||||||
indev.push_back(id);
|
indev.push_back(id);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
setKeyRepeatDelay(0, 0);
|
||||||
id.path = "/tmp/neutrino.input";
|
id.path = "/tmp/neutrino.input";
|
||||||
if (! checkpath(id)) {
|
if (! checkpath(id)) {
|
||||||
id.fd = ::open(id.path.c_str(), O_RDWR|O_NONBLOCK|O_CLOEXEC);
|
id.fd = ::open(id.path.c_str(), O_RDWR|O_NONBLOCK|O_CLOEXEC);
|
||||||
@@ -1737,6 +1741,13 @@ int CRCInput::translate(int code)
|
|||||||
|
|
||||||
void CRCInput::setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms)
|
void CRCInput::setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms)
|
||||||
{
|
{
|
||||||
|
if (start_ms == 0 && repeat_ms == 0) {
|
||||||
|
start_ms = _start_ms;
|
||||||
|
repeat_ms = _repeat_ms;
|
||||||
|
} else {
|
||||||
|
_start_ms = start_ms;
|
||||||
|
_repeat_ms = repeat_ms;
|
||||||
|
}
|
||||||
for (std::vector<in_dev>::iterator it = indev.begin(); it != indev.end(); ++it) {
|
for (std::vector<in_dev>::iterator it = indev.begin(); it != indev.end(); ++it) {
|
||||||
int fd = (*it).fd;
|
int fd = (*it).fd;
|
||||||
std::string path = (*it).path;
|
std::string path = (*it).path;
|
||||||
|
Reference in New Issue
Block a user