#include <linux/input.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/ioctl.h>
#include <fcntl.h>
#include <errno.h>
{
Log::getInstance()->log("Remote", Log::NOTICE, "Add /dev/input/event%d to List", eventid);
devices.push_back(new_fd);
+
+ // Grab the device - make it exclusive to vomp. Fixes rubbish input going to console in background
+ ioctl(new_fd, EVIOCGRAB, 1);
}
else
{
int RemoteLinux::shutdown()
{
if (!initted) return 0;
+
deinitCec();
- while (devices.size()) {
- int cur_fd = devices.back();
- devices.pop_back();
- close(cur_fd);
+ while (devices.size())
+ {
+ int cur_fd = devices.back();
+ devices.pop_back();
+ ioctl(cur_fd, EVIOCGRAB, 0);
+ close(cur_fd);
}
initted = 0;