Add help sections to describe the different touch modes, touch
actions, how to add a game etc.
A temporary version for tvOS with no images is provided as well.
The tap gestures for right/left click in the iOS port was not
protected by the TARGET_OS_IOS macro definition in the touchesMoved
method which is called when a touch is moved.
Touches are used in tvOS when controlling the mouse pointer using
the touch area on the Apple remote controller.
Fix some compiler warnings about unused variables and functions in
the tvOS port.
After adding the other long-press gestures it was hard to trigger
the gesture to show the keyboard by pressing the touch mode button
on the on-screen controls.
Changing the minimum time to trigger from 1 second to default 0.5
seconds fixed that. Add the one-touch-only requirement as well.
The ability to change touch mode between touchpad emulation and
"direct" mouse mode is kept. Inform the user about the updated
mode change and update the on-screen control button to reflect
the new mode which is useful when the on-screen controls are
disabled.
The callback functions touchesBegan, touchesMoved and touchesEnded
are from now only used for mouse pointer movements. Only one touch
is then required to be tracked.
Disable multi-touch in view to accomplish this. The setting does
not affect the gesture recognizers attached to the view, only the
touchesBegan, touchesMoved and touchesEnded callbacks are affected
that only the actions for the first touch in view are sent.
On a touch based device the touches made must be translated to
different mouse events. For example when a touch starts and is
moved that should translate to a mouse pointer movement. A quick
tap should be translated to a mouse button click while holding a
touch for a longer time without movement should be translated to
that the mouse button is kept pressed.
Add UIGestures to replace the current mouse button handling, all
done using the callback functions touchesBegan, touchesMoved and
touchesEnded.
A tap gesture with one finger is a left mouse click
A tap gesture with two fingers is a right mouse click
A long press gesture with one finger is holding the left mouse
button down until the press is released. This is accomplished by
sending an button down event when the gesture is recognized and
changes state to UIGestureRecognizerStateBegan.
A button up event is sent when the same gesture changes state to
UIGestureRecognizerStateEnded.
A long press with two fingers is as above but for the right mouse
button.
This commit adds the gestures and their actions. The current
mouse button handling is removed in upcomming commit.
The Apple guidelines for Apple TV tells that when pressing the menu
button from the root view the user shall be brought to the "Home"
screen, suspending the app. Prevent this to be done in iOS.