mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Implement SDL_HapticStopEffect on Android (thanks Rachel!)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user