Create issue
Issue #75 resolved
Pablo Ariel Mayobre created an issue

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)

  1. Konstantin Timoshenko

    You can used os.execute(), but only in rooted devices


    local dev="sys/class/timed_output/vibrator/enable"

    local duration = 100


    os.execute("echo > "..duration.." " --enable vibro on 100 ms

  2. Pablo Ariel Mayobre 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)

  3. Alex Szpakowski

    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.

  4. Pablo Ariel Mayobre reporter

    setViration(true/false) would do... for duration we can use dt

    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

  5. Pablo Ariel Mayobre reporter hahaha it would be great for later additions but well, I dont know

  6. Log in to comment