1 #include <lib/driver/rcinput.h>
3 #include <lib/base/eerror.h>
6 #include <linux/input.h>
9 #include <lib/base/ebase.h>
10 #include <lib/base/init.h>
11 #include <lib/base/init_num.h>
12 #include <lib/driver/input_fake.h>
14 void eRCDeviceInputDev::handleCode(int rccode)
16 struct input_event *ev = (struct input_event *)rccode;
19 // eDebug("%x %x %x", ev->value, ev->code, ev->type);
23 /*emit*/ input->keyPressed(eRCKey(this, ev->code, eRCKey::flagBreak));
26 /*emit*/ input->keyPressed(eRCKey(this, ev->code, 0));
29 /*emit*/ input->keyPressed(eRCKey(this, ev->code, eRCKey::flagRepeat));
34 eRCDeviceInputDev::eRCDeviceInputDev(eRCInputEventDriver *driver): eRCDevice(driver->getDeviceName(), driver)
38 const char *eRCDeviceInputDev::getDescription() const
43 class eInputDeviceInit
45 ePtrList<eRCInputEventDriver> m_drivers;
46 ePtrList<eRCDeviceInputDev> m_devices;
55 sprintf(filename, "/dev/input/event%d", i);
56 if (stat(filename, &s))
58 eRCInputEventDriver *p;
59 m_drivers.push_back(p = new eRCInputEventDriver(filename));
60 m_devices.push_back(new eRCDeviceInputDev(p));
63 eDebug("Found %d input devices!", i);
68 while (m_drivers.size())
70 delete m_devices.back();
72 delete m_drivers.back();
78 eAutoInitP0<eInputDeviceInit> init_rcinputdev(eAutoInitNumbers::rc+1, "input device driver");