mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-10 07:08:28 +02:00
rcinput: use a dynamic list of input devices
Instead of the fixed, static list of input devices, scan /dev/input/ for
proper event devices. A "good" input device is one that supports the
EVIOCGBIT ioctl and at least the EV_KEY event type.
This probably needs further fixes, e.g. in repeat rate setting code.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7b3aa2b181
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-19 (Sun, 19 Feb 2017)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Michael Liebmann
parent
3c7aca7949
commit
b5ec2b42df
@@ -39,6 +39,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
#include <OpenThreads/ScopedLock>
|
||||
|
||||
#ifdef BOXMODEL_CS_HD2
|
||||
#ifdef HAVE_COOLSTREAM_CS_IR_GENERIC_H
|
||||
#include <cs_ir_generic.h>
|
||||
@@ -138,6 +141,12 @@ class CRCInput
|
||||
bool correct_time;
|
||||
};
|
||||
|
||||
struct in_dev
|
||||
{
|
||||
int fd;
|
||||
std::string path;
|
||||
};
|
||||
|
||||
uint32_t timerid;
|
||||
std::vector<timer> timers;
|
||||
|
||||
@@ -147,21 +156,19 @@ class CRCInput
|
||||
int fd_pipe_high_priority[2];
|
||||
int fd_pipe_low_priority[2];
|
||||
int fd_gamerc;
|
||||
#ifdef HAVE_SPARK_HARDWARE
|
||||
#define NUMBER_OF_EVENT_DEVICES 2
|
||||
#else
|
||||
#define NUMBER_OF_EVENT_DEVICES 1
|
||||
#endif
|
||||
int fd_rc[NUMBER_OF_EVENT_DEVICES];
|
||||
std::vector<in_dev> indev;
|
||||
int fd_keyb;
|
||||
int fd_event;
|
||||
|
||||
int fd_max;
|
||||
int clickfd;
|
||||
__u16 rc_last_key;
|
||||
OpenThreads::Mutex mutex;
|
||||
void set_dsp();
|
||||
|
||||
void open(int dev = -1);
|
||||
void open(bool recheck = false);
|
||||
bool checkpath(in_dev id);
|
||||
bool checkdev();
|
||||
void close();
|
||||
int translate(int code);
|
||||
void calculateMaxFd(void);
|
||||
@@ -280,7 +287,9 @@ class CRCInput
|
||||
|
||||
inline int getFileHandle(void) /* used for plugins (i.e. games) only */
|
||||
{
|
||||
return fd_rc[0];
|
||||
if (indev.empty())
|
||||
return -1;
|
||||
return indev[0].fd;
|
||||
}
|
||||
void stopInput(const bool ext = false);
|
||||
void restartInput(const bool ext = false);
|
||||
|
Reference in New Issue
Block a user