[Scummvm-devel] Android port: mouse/touchscreen improvements

Michael Nicholls nicholls.mc at gmail.com
Thu Aug 5 17:51:05 CEST 2010


Hi,

I wanted to see if I could lend a hand with the Android port and help
Gus with the excellent work he has done, unfortunately I am not
familiar with the ScummVM code and so would like to run an idea past
you guys before I start work on a patch.

I have been in touch with Gus and it would seem that mouse input needs
a few fixes.

Firstly the right click needs a way to be invoked from the touchscreen
as not all phones have a camera/search button and it would be nicer to
do it via the touch screen. Gus suggested a long press on the screen
should invoke a right click. This seems sensible as long press on
Android typically brings up context menus and so can be thought of as
a right click.

Also click and drag support. At the moment all dragging on the
touchscreen represents a click and drag (I think). I guess this isn't
always desirable and Gus suggested maybe a double tap will initiate a
click drag.

I have seen in the forum that people have complained they manage to
click the wrong thing as there fingers are a lot bigger than the item
they are clicking on. It was suggested that perhaps we only respond to
releasing the touchscreen, thereby allowing the user to fine tune
where they want to click before letting go and initiating the click.

Based on all of this, as a starting point, I would like to propose the
following:

- An initial touch on the screen does nothing (except be stored to
look for long presses/double taps).
- If released before a long press timeout, we simply pass a left
button down to the vm and a left button up.
- If pressed again within the double tap timeout, we send the vm a
left button down and continue to pass the move events until released
where we pass a left button up to the vm.
- If held down past the long press timeout (without enough movement to
signify this isn't a long press) we send a right button down.
- Once the finger is released we send relevant left button up or right
button up messages depending on the state.

The main thing is I am unfamiliar with the vm and how the engines use it.

Will the above work for all the games use cases?
Is click and drag useful in some of the games?
Is it useful to be able to avoid click and drag by default as the
above scheme outlines?

Any feedback would be great, I can then get to work to try to implement it.

Cheers,
Mike




More information about the Scummvm-devel mailing list