First commit to prepare menu support for touch-based Android input:

Preparation to convert start menus from mouse move input (which does not work
at all with touch screen devices) to touch input:

New function select_menuitem_by_touch(), to be used in the next commits:
- modified:   project/jni/application/opentyrian/src/menus.cpp
- modified:   project/jni/application/opentyrian/src/menus.h

Inside #ifdef ANDROID: Disable mouse move input handling in JE_textMenuWait()
- modified:   project/jni/application/opentyrian/src/setup.cpp
This commit is contained in:
Bernhard Kaindl
2012-08-07 10:17:51 +02:00
parent 32c1bead12
commit 2cd039e9fd
3 changed files with 29 additions and 0 deletions

View File

@@ -31,7 +31,9 @@
void JE_textMenuWait( JE_word *waitTime, JE_boolean doGamma )
{
#ifdef MENU_SELECT_BY_MOUSE_MOVE
set_mouse_position(160, 100);
#endif
do
{
@@ -58,6 +60,11 @@ void JE_textMenuWait( JE_word *waitTime, JE_boolean doGamma )
if (has_mouse && input_grabbed)
{
#ifdef MENU_SELECT_BY_MOUSE_MOVE
/* Whacky hack which changes menu selecton based on
* relative mouse movement does not work with touch
* when a touch tiggers a mousedown which gets mapped
* to SDLK_RETURN above */
if (abs(mouse_y - 100) > 10)
{
inputDetected = true;
@@ -80,6 +87,7 @@ void JE_textMenuWait( JE_word *waitTime, JE_boolean doGamma )
}
newkey = true;
}
#endif
}
NETWORK_KEEP_ALIVE();