Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Mouse emulation on android

This thread is locked; no one can reply to it. rss feed Print
Mouse emulation on android
jmasterx
Member #11,410
October 2009

I was wondering if there are any plans to add this for the android port like iOS. For myself, I plan to port my game to android but agui is designed to work with mouse events. It would be very useful to have mouse emulation on android.

Thanks

amarillion
Member #940
January 2001
avatar

Could agui be made to understand touch events? I think that would be a nicer solution for the long-term.

George24
Member #14,359
June 2012

I have not tested this, but is mouse emulation mode not working with Android?

If it works, you could set:

al_set_mouse_emulation_mode(ALLEGRO_MOUSE_EMULATION_TRANSPARENT);

jmasterx
Member #11,410
October 2009

You're right George looks like it is implemented:
https://github.com/liballeg/allegro5/blob/5.1/src/android/android_touch.c
In that case the Android todo should be updated:
https://github.com/liballeg/allegro5/blob/5.1/README_android.txt#L260

Maybe there are other parts of that section that should be updated..

Polybios
Member #12,293
October 2010

For things like a ScrollArea, you'll need genuine touch support anyway, I guess.

jmasterx
Member #11,410
October 2009

Surprisingly I got around this by simulating mousewheel events on scroll areas on mobile and then having an option to generate inertia events for those events. It works really well on iOS. Should work the same on Android.

Go to: