aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorendolf <[email protected]>2004-04-21 16:19:42 +0000
committerendolf <[email protected]>2004-04-21 16:19:42 +0000
commit2b0bdf9979ac5dd092883685843000c9f0884f4a (patch)
tree613d7219aec2243ead12cf7c625477419b2781a9
parent1af878753ad5c62478c4d9ac1dd4deed2e5d47fe (diff)
Updated the type guess code so that anything that doesn't have a characteristic of a particular type, wont get guessed as that type, it was possible for devices with no characteristics of any of the known types to be classed as a stick, now it should not.
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@78 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxDevice.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxDevice.java b/plugins/linux/src/java/net/java/games/input/LinuxDevice.java
index 5fa49d6..0ed7c98 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxDevice.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxDevice.java
@@ -355,22 +355,26 @@ public class LinuxDevice extends AbstractController {
// no sweat, it's non of the above, erg
}
}
- if((joystickCharacteristic >= digitiserCharacteristic) &&
+ if((joystickCharacteristic > 0) &&
+ (joystickCharacteristic >= digitiserCharacteristic) &&
(joystickCharacteristic >= gamepadCharacteristic) &&
(joystickCharacteristic >= miscCharacteristic) &&
(joystickCharacteristic >= mouseCharacteristic)) {
typeGuess = Type.STICK;
- } else if((gamepadCharacteristic >= digitiserCharacteristic) &&
+ } else if((gamepadCharacteristic > 0) &&
+ (gamepadCharacteristic >= digitiserCharacteristic) &&
(gamepadCharacteristic >= joystickCharacteristic) &&
(gamepadCharacteristic >= miscCharacteristic) &&
(gamepadCharacteristic >= mouseCharacteristic)) {
typeGuess = Type.GAMEPAD;
- } else if((digitiserCharacteristic >= gamepadCharacteristic) &&
+ } else if((digitiserCharacteristic > 0) &&
+ (digitiserCharacteristic >= gamepadCharacteristic) &&
(digitiserCharacteristic >= joystickCharacteristic) &&
(digitiserCharacteristic >= miscCharacteristic) &&
(digitiserCharacteristic >= mouseCharacteristic)) {
typeGuess = Type.TRACKPAD;
- } else if((miscCharacteristic >= gamepadCharacteristic) &&
+ } else if((miscCharacteristic > 0) &&
+ (miscCharacteristic >= gamepadCharacteristic) &&
(miscCharacteristic >= joystickCharacteristic) &&
(miscCharacteristic >= miscCharacteristic) &&
(miscCharacteristic >= mouseCharacteristic)) {
@@ -378,7 +382,8 @@ public class LinuxDevice extends AbstractController {
// wise a LinuxKeyboard would have been constructed, so assume its
// some kind of stick;
typeGuess = Type.STICK;
- } else if((mouseCharacteristic >= digitiserCharacteristic) &&
+ } else if((mouseCharacteristic > 0) &&
+ (mouseCharacteristic >= digitiserCharacteristic) &&
(mouseCharacteristic >= joystickCharacteristic) &&
(mouseCharacteristic >= miscCharacteristic) &&
(mouseCharacteristic >= gamepadCharacteristic)) {