summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorendolf <[email protected]>2005-05-04 18:15:08 +0000
committerendolf <[email protected]>2005-05-04 18:15:08 +0000
commit74b6d5aa74b4926a63f7506afa3b3a8eede31866 (patch)
treefac88b20d4f0dba0d08edc6eb941c89c256543ec
parentf18cd33d4220af2d27bcc796dfdcbabaea624608 (diff)
Event devices now opened read only
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@88 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rw-r--r--plugins/linux/src/native/EventDevice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/linux/src/native/EventDevice.cpp b/plugins/linux/src/native/EventDevice.cpp
index e616fb3..64ac8cb 100644
--- a/plugins/linux/src/native/EventDevice.cpp
+++ b/plugins/linux/src/native/EventDevice.cpp
@@ -40,7 +40,7 @@ EventDevice::EventDevice(char *deviceFileName) {
char tempName[Device::MAX_NAME_LENGTH-1] = "Unknown";
int i;
- fd = open(deviceFileName, O_RDWR | O_NONBLOCK);
+ fd = open(deviceFileName, O_RDONLY | O_NONBLOCK);
if(fd<0) {
/*char errorMessage[512];
sprintf(errorMessage, "Error opening device %s\n", deviceFileName);
@@ -313,9 +313,10 @@ int EventDevice::poll(){
int numEventsRead = (int) (read_bytes / sizeof(struct input_event));
for(i=0;i<numEventsRead;i++) {
switch(events[i].type) {
- case EV_SYN:
- // not sure what to do with it, ignore for now -- JPK
- break;
+ case EV_SYN:
+ case EV_MSC:
+ // not sure what to do with it, ignore for now -- JPK
+ break;
case EV_KEY: {
dataChanged = 1;
int buttonIndex = buttonLookup[events[i].code];