diff options
Diffstat (limited to 'plugins/windows/src/java/net')
-rw-r--r-- | plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java | 10 | ||||
-rw-r--r-- | plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java index 46c9b7d..a7fa563 100644 --- a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java +++ b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java @@ -140,12 +140,16 @@ public final class DirectInputEnvironmentPlugin extends ControllerEnvironment im return createMouseFromDevice(device); case IDirectInputDevice.DI8DEVTYPE_KEYBOARD: return createKeyboardFromDevice(device); - case IDirectInputDevice.DI8DEVTYPE_JOYSTICK: - return createControllerFromDevice(device, Controller.Type.STICK); case IDirectInputDevice.DI8DEVTYPE_GAMEPAD: return createControllerFromDevice(device, Controller.Type.GAMEPAD); + case IDirectInputDevice.DI8DEVTYPE_DRIVING: + return createControllerFromDevice(device, Controller.Type.WHEEL); + case IDirectInputDevice.DI8DEVTYPE_FLIGHT: + /* Fall through */ + case IDirectInputDevice.DI8DEVTYPE_JOYSTICK: + /* Fall through */ default: - return null; + return createControllerFromDevice(device, Controller.Type.STICK); } } 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 ef061cd..2e3e22f 100644 --- a/plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java +++ b/plugins/windows/src/java/net/java/games/input/IDirectInputDevice.java @@ -250,11 +250,11 @@ final class IDirectInputDevice { private final List createRumblers() throws IOException { DIDeviceObject x_axis = lookupObjectByGUID(GUID_XAxis); - DIDeviceObject y_axis = lookupObjectByGUID(GUID_YAxis); - if(x_axis == null || y_axis == null) +// DIDeviceObject y_axis = lookupObjectByGUID(GUID_YAxis); + if(x_axis == null/* || y_axis == null*/) return rumblers; - DIDeviceObject[] axes = {x_axis, y_axis}; - long[] directions = {0, 0}; + DIDeviceObject[] axes = {x_axis/*, y_axis*/}; + long[] directions = {0/*, 0*/}; for (int i = 0; i < effects.size(); i++) { DIEffectInfo info = (DIEffectInfo)effects.get(i); if ((info.getEffectType() & 0xff) == DIEFT_PERIODIC && @@ -270,7 +270,7 @@ final class IDirectInputDevice { for (int i = 0; i < axis_ids.length; i++) { axis_ids[i] = axes[i].getDIIdentifier(); } - long effect_address = nCreatePeriodicEffect(address, info.getGUID(), DIEFF_CARTESIAN | DIEFF_OBJECTIDS, INFINITE, 0, 0, DIEB_NOTRIGGER, 0, axis_ids, directions, 0, 0, 0, 0, DI_FFNOMINALMAX, 0, 0, 50000, 0); + long effect_address = nCreatePeriodicEffect(address, info.getGUID(), DIEFF_CARTESIAN | DIEFF_OBJECTIDS, INFINITE, 0, DI_FFNOMINALMAX, DIEB_NOTRIGGER, 0, axis_ids, directions, 0, 0, 0, 0, DI_FFNOMINALMAX, 0, 0, 50000, 0); return new IDirectInputEffect(effect_address, info); } private final static native long nCreatePeriodicEffect(long address, byte[] effect_guid, int flags, int duration, int sample_period, int gain, int trigger_button, int trigger_repeat_interval, int[] axis_ids, long[] directions, int envelope_attack_level, int envelope_attack_time, int envelope_fade_level, int envelope_fade_time, int periodic_magnitude, int periodic_offset, int periodic_phase, int periodic_period, int start_delay) throws IOException; |