aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorelias <[email protected]>2006-08-11 08:44:12 +0000
committerelias <[email protected]>2006-08-11 08:44:12 +0000
commit72cdb69f0792e3f173d960afa7999b639ef7bb12 (patch)
tree22b05b065bfaf0fa40ac7eb34f8b005e24dc9424 /plugins
parent5d9f44b1beaec1f2f23f32f27c8c5b459f8cf9f0 (diff)
Linux: Ignore rumblers when device is read only
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@161 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java b/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java
index bcd941a..08cb8f2 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java
@@ -48,25 +48,29 @@ final class LinuxEventDevice implements LinuxDevice {
*/
private boolean closed;
- /* Access the the key_states array could be synchronized, but
+ /* Access to the key_states array could be synchronized, but
* it doesn't hurt to have multiple threads read/write from/to it
*/
private final byte[] key_states = new byte[NativeDefinitions.KEY_MAX/8 + 1];
public LinuxEventDevice(String filename) throws IOException {
long fd;
+ boolean detect_rumblers = true;
try {
fd = nOpen(filename, true);
} catch (IOException e) {
- ControllerEnvironment.logln("Failed to open device R/W: " + e.getMessage());
fd = nOpen(filename, false);
+ detect_rumblers = false;
}
this.fd = fd;
try {
this.name = getDeviceName();
this.input_id = getDeviceInputID();
this.components = getDeviceComponents();
- this.rumblers = enumerateRumblers();
+ if (detect_rumblers)
+ this.rumblers = enumerateRumblers();
+ else
+ this.rumblers = new Rumbler[]{};
this.type = guessType();
} catch (IOException e) {
close();