Implement SDL_HapticStopEffect on Android (thanks Rachel!)
This commit is contained in:
parent
69441bd02e
commit
8dab95ee3d
4 changed files with 26 additions and 1 deletions
|
@ -81,6 +81,14 @@ public class SDLControllerManager
|
|||
mHapticHandler.run(device_id, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void hapticStop(int device_id)
|
||||
{
|
||||
mHapticHandler.stop(device_id);
|
||||
}
|
||||
|
||||
// Check if a given device is considered a possible SDL joystick
|
||||
public static boolean isDeviceSDLJoystick(int deviceId) {
|
||||
InputDevice device = InputDevice.getDevice(deviceId);
|
||||
|
@ -422,6 +430,13 @@ class SDLHapticHandler {
|
|||
}
|
||||
}
|
||||
|
||||
public void stop(int device_id) {
|
||||
SDLHaptic haptic = getHaptic(device_id);
|
||||
if (haptic != null) {
|
||||
haptic.vib.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
public void pollHapticDevices() {
|
||||
|
||||
final int deviceId_VIBRATOR_SERVICE = 999999;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue