diff options
author | elias <[email protected]> | 2006-08-23 08:04:50 +0000 |
---|---|---|
committer | elias <[email protected]> | 2006-08-23 08:04:50 +0000 |
commit | f9d6bf71a07e8b62227b9f618dbdfd8c2b57ca20 (patch) | |
tree | 5c92e6812744c5fcd03d9f66c4c8a66b7ba81d54 /plugins/windows | |
parent | 4ff1e85521b53e0cde2e21c671c6b0a2a8664a93 (diff) |
DirectInput: Only choose DIDF_RELAXIS id the device has at least one axis, and all axes are relative
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@165 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/windows')
-rw-r--r-- | plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java b/plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java index 7201b92..86eea1c 100644 --- a/plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java +++ b/plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java @@ -240,14 +240,18 @@ final class IDirectInputDevice { * obscure reason. */ boolean all_relative = true; + boolean has_axis = false; for (int i = 0; i < objects.size(); i++) { DIDeviceObject obj = (DIDeviceObject)objects.get(i); - if (obj.isAxis() && !obj.isRelative()) { - all_relative = false; - break; + if (obj.isAxis()) { + has_axis = true; + if (!obj.isRelative()) { + all_relative = false; + break; + } } } - this.axes_in_relative_mode = all_relative; + this.axes_in_relative_mode = all_relative && has_axis; int axis_mode = all_relative ? DIDF_RELAXIS : DIDF_ABSAXIS; setDataFormat(axis_mode); if (rumblers.size() > 0) { |