Someone (undef) in the forum suggested vibration support for android. Since it would be nice to give some haptic feedback to the user (I like the idea).
This is not implemented in SDL so I don't know if it would be possible to do it with it so maybe with the NDK itself?
Comments (9)
-
-
reporter Awesome! It seems like a hack hahaha it would be nice to have native control on this (and support every device, even the non-rooted ones) plus it could be added to iPhone too (@slime73)
-
reporter I found this answer in stackoverflow and it seems rather simple to do in java
-
A decent place to stick phone vibration in the current API would be
Joystick:setVibration
on the accelerometer-joystick object.it could be added to iPhone too
The iOS API for iPhone vibration doesn't have much control over duration, unfortunately.
-
reporter setViration(true/false)
would do... for duration we can usedt
I don't think that the accelerometer-joystick is the best place, since sometimes you disable the accelerometer (
love.config
), plus it would be nice to have it separated so anyone who doesn't need it can delete the manifest part of it -
setVibration(true/false)
would doIn which module?
-
reporter love.phone
? hahaha it would be great for later additions but well, I dont know -
repo owner - changed status to resolved
Implemented as of 6110de0. Use
love.system.vibrate(seconds)
. -
cool!
- Log in to comment
You can used os.execute(), but only in rooted devices
Example:
local dev="sys/class/timed_output/vibrator/enable"
local duration = 100
os.execute("su")--super
os.execute("echo > "..duration.." "..dev) --enable vibro on 100 ms