1. rmtew
  2. broguex

Commits

rmtew  committed e787f59

- Added "move tapping" options menu.
- Added flick/swipe to move "move tapping" option (disabled by default).
- Made long press as mouse click a "move tapping" option (enabled by default).
- Made tap screen outer quadrants to move a "move tapping" option (enabled by default).
- Made tap screen center quadrant as enter key a "move tapping" option (enabled by default).
- Made extra button on button row as enter key a "move tapping" option (enabled by default).

  • Participants
  • Parent commits 977f706
  • Branches default
  • Tags broguex-1.7.2.19

Comments (0)

Files changed (7)

File AndroidManifest.xml

View file
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="org.disinterest.broguex"
-      android:versionCode="18"
-      android:versionName="1.7.2.18">
+      android:versionCode="19"
+      android:versionName="1.7.2.19">
     <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-    <application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+    <application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="true">
         <activity android:name="SDLActivity"
                   android:label="@string/app_name" android:screenOrientation="landscape" android:windowSoftInputMode="stateAlwaysHidden|adjustPan" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
             <intent-filter>

File res/layout/move_tapping_options.xml

View file
+<?xml version="1.0" encoding="utf-8"?>
+	<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+		android:id="@+id/scrollView_movetap"
+		android:layout_width="match_parent"
+		android:layout_height="0dip"
+		android:layout_weight="0.38" >
+
+		<LinearLayout
+			android:layout_width="fill_parent"
+			android:layout_height="fill_parent"
+			android:orientation="vertical" >
+
+			<CheckBox
+			    android:id="@+id/checkbox_movetap_long_press"
+			    android:layout_width="wrap_content"
+			    android:layout_height="wrap_content"
+			    android:onClick="onMoveTapCheckBoxClick"
+			    android:text="@string/option_long_press_name" />
+
+			<RadioGroup
+			    android:layout_width="match_parent"
+			    android:layout_height="wrap_content"
+			    android:orientation="vertical" >
+
+				<RadioButton
+				    android:id="@+id/radiobutton_movetap_flick_to_move"
+				    android:layout_width="wrap_content"
+				    android:layout_height="wrap_content"
+				    android:onClick="onMoveTapRadioButtonClick"
+				    android:text="@string/option_flick_to_move" />
+
+				<RadioButton
+				    android:id="@+id/radiobutton_movetap_tap_quadrants"
+				    android:layout_width="wrap_content"
+				    android:layout_height="wrap_content"
+				    android:onClick="onMoveTapRadioButtonClick"
+				    android:text="@string/option_move_tap_quadrants" />
+
+			</RadioGroup>
+
+			<LinearLayout
+				android:layout_width="match_parent"
+				android:layout_height="match_parent"
+				android:orientation="vertical" >
+
+				<CheckBox
+				    android:id="@+id/checkbox_movetap_enter_center_tap"
+				    android:layout_width="wrap_content"
+				    android:layout_height="wrap_content"
+				    android:onClick="onMoveTapCheckBoxClick"
+				    android:text="@string/option_enter_center_tap" />
+
+				<CheckBox
+				    android:id="@+id/checkbox_movetap_enter_check_button"
+				    android:layout_width="wrap_content"
+				    android:layout_height="wrap_content"
+				    android:onClick="onMoveTapCheckBoxClick"
+				    android:text="@string/option_enter_check_button" />
+
+			</LinearLayout>
+
+		</LinearLayout>
+	</ScrollView>

File res/menu/main.xml

View file
             <item android:id="@+id/fps_90_menu_item" android:checkable="true" android:title="@string/fps_90_menu_item_name"/>
             <item android:id="@+id/fps_unlimited_menu_item" android:checkable="true" android:title="@string/fps_unlimited_menu_item_name"/>
         </group>
-</menu>
+		</menu>
     </item>
     <item android:id="@+id/dev_menu_item" android:titleCondensed="@string/dev_name" android:title="@string/development_name" android:enabled="false" android:visible="false">
         <menu>
     </item>
     <item android:id="@+id/options_menu_item" android:enabled="true" android:title="@string/options_menu_item" android:visible="true" android:titleCondensed="@string/options_menu_item">
         <menu>
-            <item android:id="@+id/help_menu_item" android:title="@string/help_menu_item_name" android:enabled="true" android:visible="true" /><item android:id="@+id/toggle_move_tapping_menu_item" android:titleCondensed="@string/toggle_move_tapping_menu_item_cname" android:enabled="true" android:checked="false" android:title="@string/toggle_move_tapping_menu_item_name" android:checkable="true" android:visible="true" /><item android:id="@+id/toggle_keyboard_menu_item" android:title="@string/toggle_keyboard_menu_item_name" android:visible="true" android:enabled="true"/>
-            
-            
-            <item android:id="@+id/scaling_fs_menu_item" android:titleCondensed="@string/scaling_fs_menu_item_cname" android:title="@string/scaling_fs_menu_item_name" android:enabled="true" android:visible="true"/><item android:id="@+id/scaling_font_menu_item" android:visible="true" android:enabled="true" android:title="@string/scaling_menu_item_name" />
+            <item android:id="@+id/help_menu_item" android:title="@string/help_menu_item_name" android:enabled="true" android:visible="true"/>
+            <item android:id="@+id/toggle_move_tapping_menu_item" android:titleCondensed="@string/toggle_move_tapping_menu_item_cname" android:enabled="true" android:checked="false" android:title="@string/toggle_move_tapping_menu_item_name" android:checkable="true" android:visible="true"/>
+            <item android:id="@+id/open_move_tapping_context_menu" android:checkable="false" android:enabled="false" android:visible="true" android:title="@string/move_tapping_options_name" android:titleCondensed="@string/move_tapping_options_name"/><item android:id="@+id/toggle_keyboard_menu_item" android:title="@string/toggle_keyboard_menu_item_name" android:visible="true" android:enabled="true"/>                       
+            <item android:id="@+id/scaling_fs_menu_item" android:titleCondensed="@string/scaling_fs_menu_item_cname" android:title="@string/scaling_fs_menu_item_name" android:enabled="true" android:visible="true"/>
+            <item android:id="@+id/scaling_font_menu_item" android:visible="true" android:enabled="true" android:title="@string/scaling_menu_item_name"/>
             
         </menu>
     </item>

File res/raw/help.txt

View file
-There are several ways to control the game.
+1. Introduction.
+2. Move tapping.
+3. Move tapping & inventory.
+4. Move tapping & cursor mode.
+5. Quitting.
 
-* Standard Android buttons.
-* Touching tiles.
-* BrogueX overlay buttons (default).
-* Keyboard.
+1. INTRODUCTION
 
-STANDARD ANDROID BUTTONS
+BrogueX comes with the "move tapping layer" enabled.
 
-These buttons are available whichever form of input you choose, though they are likely most helpful if using the directional movement.
+Players with a real keyboard might disable the "move tapping layer".  They should be able to play BrogueX with key presses, as it is played on a PC, MacOS or Linux computer.  Note that in this case, the space key or Android back button can be used in place of any missing escape key.
 
+For those without a real keyboard, the "move tapping layer" allows play of the game through touch and gestures.
+
+Standard Android buttons and their use:
 * Back key: Mapped to the escape key.  This will allow you to exit menus, requests to input file names and more.
 * Menu key: Displays the BrogueX Android menu options.
 
-TOUCHING TILES
+2. MOVE TAPPING
 
-Simply touch the character or UI element you wish to interact with.  If your device has too small a screen to allow accurate tile touching,
-then you can use the standard pinch and zoom gesture that you might use when viewing maps, pictures or web pages on your mobile device.
+By default, the following controls are available:
 
-BROGUEX OVERLAY BUTTONS
+* Tapping screen areas to move.
+* Tapping screen area as enter key press.
+* Long press screen as mouse click.
+* Android UI button overlay.
 
-If you choose to enable the "Move Tapping Layer" menu item, you can tap areas of the screen to move.
+These additionally controls can be enabled by menu options:
+
+* Flick in a compass direction to move.
+* Extra Android UI button for enter key press.
+
+Note that moving repeatedly can be a much smaller number of key presses, if cursor mode is used.
+
+Tapping screen areas to move:
 
 * Upper left: up and left (numeric keypad 7).
 * Upper center: up (numeric keypad 8).
 * Upper right: up and right (numeric keypad 9).
 * Middle left: left (numeric keypad 4).
-* Middle: enter (enter key).
 * Middle right: right (numeric keypad 6).
 * Lower left: down and left (numeric keypad 1).
 * Lower center: down (numeric keypad 2).
 * Lower right: down and right (numeric keypad 3).
 
-To enable this touch mode, check the Options / Move tapping layer menu item.  And to disable it, uncheck the menu item.
+Tapping screen area as enter key press:
 
-When your inventory is displayed, you can press the "up" to go up an item, "down" to go down an item and "left" to exit the inventory. If you are asked to press a key to continue, just touch the screen anywhere.
+* Middle center: enter (enter key).
 
-What about cursor mode?  This is when moving moves the cursor, leaving a trail from it to your character.
+If asked to press a key to continue, the Android back button will work if no other alternatives are obvious.
 
-* To directly enter cursor mode, touch the middle of the screen (basically the enter key).
+3. MOVE TAPPING & INVENTORY
+
+The inventory does not display an Android UI button overlay.  The following touches or gestures work:
+
+* Go up an item: Flick up (if enabled) or press upper center screen area (if enabled).
+* Go down an item: Flick down (if enabled) or press lower center screen area (if enabled).
+* Exit menu: Android back button.
+
+4. MOVE TAPPING & CURSOR MODE
+
+Cursor mode is active when touches or gestures which should move the player, moves the cursor instead.  This leaves a trail from the cursor to your character.
+
+* To directly enter cursor mode, do an enter keypress.
 * To place the cursor and enter cursor mode, long press (hold finger on) the map position you wish to have selected.
 * To select an item featured in the left hand overview pane with the cursor and enter cursor mode, long press (hold finger on) the entry in the left hand overview panel.
-* To exit the cursor mode, press the Android back key.  Pressing the center of the screen (again, the enter key) will move to the cursor position.
+* To select another location on the map with the cursor and enter cursor mode, long press (hold finger on) the approximate character
+* To move to the selected cursor position, do an enter keypress.
+* To simply exit the cursor mode, press the Android back key.
 
-KEYBOARD
+5. QUITTING BROGUEX
 
-If you have an external keyboard for your device, then you may use it to play the game.  Note that there is no escape key, and
-where you would otherwise use escape, you can instead use space or the Android back button.  That is, to dismiss UI items and the like.
-
-QUITTING BROGUEX
-
-The Android operating system does not allow an application to quit.  It should simply minimize, pause and when it's resources are needed, it will be killed automatically.
+The Android operating system does not allow an application to quit.  It should simply minimise, pause and when it's resources are needed, it will be killed automatically.  This means that when you Quit from the main menu, it does not kill the application, but minimises it instead.

File res/raw/releasenotes.txt

View file
-BrogueX 18 (Brogue 1.7.2)
+BrogueX 19 (Brogue 1.7.2)
 * Bad reviews do not contain enough information about complaints and problems.  So email (as well) please!
-* See the "help" menu item for information about controls.
 
 TIPS
+- See the "help" menu item for information about controls.
+- Cursor mode can get you somewhere faster.
 - If you have a smaller screen and the display appears corrupt, see the Play store page bug list for an explanation/workaround.
-- If you do not have a keyboard, it is recommended that you turn on the "move tapping layer" menu option.
-- The move tapping layer turns the screen into an invisible keyboard.  See the Android "help" menu option for details.
 
 RECENT CHANGES
-- Long pressing the screen in "move tapping layer" will perform a mouse click at that position.  Read below for a summary, and also the help menu for the complete breakdown.
-
-Note: Mouse clicks behave exactly the same, as they do in the Linux, Windows or MacOS versions of Brogue.  You can use it to select a map location, to quickly move there.  You can use it to select an item or monster that is within your field of view, to then move to them.  Selection can be cancelled by pressing your device's back key (the escape key).  The current selection can be moved towards by pressing the center of the screen (the enter key).
+- New "move tapping options" submenu.  This allows the user to selectively enable different move tapping layer controls.
+- Added "move tapping" ability to flick in a compass direction as a way to do the corresponding key press.
+- Added "move tapping" ability to have extra enter key button in Android UI menus.
 
 CONTACT INFORMATION
 richard.m.tew@gmail.com

File res/values/strings.xml

View file
     <string name="toggle_move_tapping_menu_item_name">Move tapping layer</string>
     <string name="toggle_move_tapping_menu_item_cname">Move layer</string>
     <string name="help_menu_item_name">Help</string>
+    <string name="option_long_press_name">Long press as mouse click</string>
+    <string name="option_long_press_cname">Long press</string>
+    <string name="option_flick_to_move">Flick to move</string>
+    <string name="option_move_tap_quadrants">Move tap quadrants</string>
+    <string name="option_enter_center_tap">Enter as center tap</string>
+    <string name="option_enter_check_button">Enter as extra button</string>
+    <string name="move_tapping_options_name">Move tapping options</string>
 </resources>

File src/org/disinterest/broguex/SDLActivity.java

View file
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Hashtable;
 
 import javax.microedition.khronos.egl.EGL10;
 import android.widget.CompoundButton.OnCheckedChangeListener;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
+import android.widget.RadioButton;
 import android.widget.TextView;
 import android.os.*;
 import android.util.Log;
     private static InputMethodManager mInputManager;
     private static int mKeyboardDeviceID;
     private static KeyCharacterMap mKeyMap;
-
+    private static Menu mOptionsMenu;
+    
     private static boolean mShowReleaseNotes;
     private static int mTCODFPS;
     private static boolean mMoveTapping;
+    private static boolean mMoveTapLongPressAsLMB;
+    private static boolean mMoveTapFlickAsMove;
+    private static boolean mMoveTapTouchAreasAsMove;
+    private static boolean mMoveTapTouchAreaAsEnter;
+    private static boolean mMoveTapButtonAsEnter;
     private static String mVersionName;
     private static boolean mDebuggable;
     
     public static final String PREFS_TCOD_FPS_LIMIT = "use-tcod-fps-limit";
     public static final String PREFS_RELEASE_NOTES_SEEN = "release-note-version";
     public static final String PREFS_JAVA_UI = "java-ui";
+    public static final String PREFS_JAVA_UI_LONGPRESS_AS_LMB = "java-ui-long-click-lmb";
+    public static final String PREFS_JAVA_UI_FLICK_AS_MOVE = "java-ui-flick-move";
+    public static final String PREFS_JAVA_UI_TOUCH_AS_MOVE = "java-ui-touch-move";
+    public static final String PREFS_JAVA_UI_TOUCH_AS_ENTER = "java-ui-touch-enter";
+    public static final String PREFS_JAVA_UI_BUTTON_AS_ENTER = "java-ui-button-enter";
     
     public static Hashtable<Character, Integer> mCharToKeycode;
     
 
     	SharedPreferences prefs = getPreferences(MODE_PRIVATE);
     	mMoveTapping = prefs.getBoolean(PREFS_JAVA_UI, true);
+    	mMoveTapLongPressAsLMB = prefs.getBoolean(PREFS_JAVA_UI_LONGPRESS_AS_LMB, true);
+        mMoveTapFlickAsMove = prefs.getBoolean(PREFS_JAVA_UI_FLICK_AS_MOVE, false);
+        mMoveTapTouchAreasAsMove = prefs.getBoolean(PREFS_JAVA_UI_TOUCH_AS_MOVE, true);
+        mMoveTapTouchAreaAsEnter = prefs.getBoolean(PREFS_JAVA_UI_TOUCH_AS_ENTER, true);
+        mMoveTapButtonAsEnter = prefs.getBoolean(PREFS_JAVA_UI_BUTTON_AS_ENTER, false);
     	mTCODFPS = prefs.getInt(PREFS_TCOD_FPS_LIMIT, 30);
     	SDLActivity.nativeTCODSetFPS(mTCODFPS);
-
+    	
     	/* Initialise the release notes related malarkey. */
     	String rnVersionName = prefs.getString(PREFS_RELEASE_NOTES_SEEN, "");
     	try {
     }
     
     // Custom functions..
-    
+	
 	@Override
 	public boolean onCreateOptionsMenu(Menu menu) {
 		boolean flag = super.onCreateOptionsMenu(menu);
 	    	MenuInflater inflater = getMenuInflater();
 	    	inflater.inflate(R.menu.main, menu);
 		}
+		mOptionsMenu = menu;
 		return flag;
 	}
 	
 		
 		item = menu.findItem(R.id.toggle_move_tapping_menu_item);
 		item.setChecked(mMoveTapping);
+		item = menu.findItem(R.id.open_move_tapping_context_menu);
+		item.setEnabled(mMoveTapping);
 		
 		item = menu.findItem(R.id.dev_menu_item);
 		item.setVisible(mDebuggable);
 	}
 
 	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {		
-		if (super.onOptionsItemSelected(item))
-			return true;
-
+	public boolean onOptionsItemSelected(MenuItem item) {
+		MenuItem item2;
+		
 		int fps_value = 0;
-		SharedPreferences prefs;
-		SharedPreferences.Editor prefsEd;
 
 		switch (item.getItemId()) {
 		case R.id.help_menu_item:
 					brogueMenuState.dismiss();
 			}
 
-			/* Persist new setting. */
-	    	prefs = getPreferences(MODE_PRIVATE);
-	    	prefsEd = prefs.edit();
-	    	prefsEd.putBoolean(PREFS_JAVA_UI, mMoveTapping);
-	    	prefsEd.commit();
+			/* Immediate visible change to checkbox. */
+			item.setChecked(mMoveTapping);
+
+			/* Matching immediate enabling of options item. */
+			item2 = mOptionsMenu.findItem(R.id.open_move_tapping_context_menu);
+			item2.setEnabled(mMoveTapping);
+				
+	    	savePrefsBooleanOption(PREFS_JAVA_UI, mMoveTapping);
 
 	    	break;
+		case R.id.open_move_tapping_context_menu:
+			AlertDialog.Builder builder = new AlertDialog.Builder(this);
+			builder.setTitle("UI Options");
+	    	LayoutInflater factory = LayoutInflater.from(this);
+	        final View alertView = factory.inflate(R.layout.move_tapping_options, null);
+	        CheckBox checkbox = (CheckBox) alertView.findViewById(R.id.checkbox_movetap_long_press);
+	        checkbox.setChecked(mMoveTapLongPressAsLMB);
+	        checkbox = (CheckBox) alertView.findViewById(R.id.checkbox_movetap_enter_center_tap);
+	        RadioButton radiobutton = (RadioButton) alertView.findViewById(R.id.radiobutton_movetap_flick_to_move);
+	        radiobutton.setChecked(mMoveTapFlickAsMove);
+	        radiobutton = (RadioButton) alertView.findViewById(R.id.radiobutton_movetap_tap_quadrants);
+	        radiobutton.setChecked(mMoveTapTouchAreasAsMove);
+	        checkbox.setChecked(mMoveTapTouchAreaAsEnter);
+	        checkbox = (CheckBox) alertView.findViewById(R.id.checkbox_movetap_enter_check_button);
+	        checkbox.setChecked(mMoveTapButtonAsEnter);
+			builder.setView(alertView);
+			builder.show();
+			break;
 		case R.id.toggle_keyboard_menu_item:
 			/* This comes back to Java in a roundabout way, but should make SDL's API more reliable. */
 			nativeSDLToggleScreenKeyboard();
 		case R.id.fps_unlimited_menu_item:
 			mTCODFPS = fps_value;
 			item.setChecked(true);
-			
-			/* Persist new setting. */
-	    	prefs = getPreferences(MODE_PRIVATE);
-	    	prefsEd = prefs.edit();
-	    	prefsEd.putInt(PREFS_TCOD_FPS_LIMIT, mTCODFPS);
-	    	prefsEd.commit();
+	    	savePrefsIntOption(PREFS_TCOD_FPS_LIMIT, mTCODFPS);
 	    	
 	    	SDLActivity.nativeTCODSetFPS(mTCODFPS);	    	
 			break;
 		default:
-			return false;
+			return super.onOptionsItemSelected(item);
 		}
 		return true;
 	}
+	
+	public void onMoveTapCheckBoxClick(View view) {
+		CheckBox checkbox = (CheckBox)view;
+		boolean value = checkbox.isChecked();
+		switch (checkbox.getId()) {
+		case R.id.checkbox_movetap_long_press:
+			brogueSetMoveTapLongPressAsLMB(value);
+			break;
+		case R.id.checkbox_movetap_enter_center_tap:
+			brogueSetMoveTapTouchAreaAsEnter(value);
+			break;
+		case R.id.checkbox_movetap_enter_check_button:
+			brogueSetMoveTapButtonAsEnter(value);
+			/* Refresh the menu buttons for the potential addition or removal of the enter button. */
+			if (brogueMenuState != null) {
+				brogueMenuState.dismiss();
+				brogueMenuState.display();
+			}
+			break;
+		}
+	}
+
+	public void onMoveTapRadioButtonClick(View view) {
+		RadioButton radiobutton = (RadioButton)view;
+		boolean value = radiobutton.isChecked();
+		switch (radiobutton.getId()) {
+		case R.id.radiobutton_movetap_tap_quadrants:
+	    	brogueSetMoveTapTouchAreasAsMove(value);
+	    	brogueSetMoveTapFlickAsMove(!value);
+			break;
+		case R.id.radiobutton_movetap_flick_to_move:
+	    	brogueSetMoveTapFlickAsMove(value);
+	    	brogueSetMoveTapTouchAreasAsMove(!value);
+			break;
+		}
+	}
+
+	private void savePrefsBooleanOption(String key, boolean value) {
+		SharedPreferences prefs;
+		SharedPreferences.Editor prefsEd;
+		
+    	prefs = getPreferences(MODE_PRIVATE);
+    	prefsEd = prefs.edit();
+    	prefsEd.putBoolean(key, value);
+    	prefsEd.commit();
+	}
+
+	private void savePrefsIntOption(String key, int value) {
+		SharedPreferences prefs;
+		SharedPreferences.Editor prefsEd;
+		
+    	prefs = getPreferences(MODE_PRIVATE);
+    	prefsEd = prefs.edit();
+    	prefsEd.putInt(key, value);
+    	prefsEd.commit();
+	}
 
 	/**
      * Wraps KeyCharacterMap.get
 			    	SharedPreferences prefs = getPreferences(MODE_PRIVATE);
 			    	SharedPreferences.Editor prefsEd = prefs.edit();
 			    	prefsEd.putString(PREFS_RELEASE_NOTES_SEEN, mVersionName);
-			    	boolean savedSuccessfully = prefsEd.commit();
+			    	/* boolean savedSuccessfully = */ prefsEd.commit();
 				}
 			}
 		});
     public static void openMenu() {
     	mSingleton.openOptionsMenu();
     }
+        
+    /* BrogueX hack layer begins. */
+
+    public void brogueSetMoveTapLongPressAsLMB(boolean value) {
+    	mMoveTapLongPressAsLMB = value;
+    	savePrefsBooleanOption(PREFS_JAVA_UI_LONGPRESS_AS_LMB, value);
+    }
     
-    /* BrogueX hack layer begins. */
+    public static boolean brogueGetMoveTapLongPressAsLMB() {
+    	return mMoveTapLongPressAsLMB;
+    }
+
+    public void brogueSetMoveTapFlickAsMove(boolean value) {
+    	mMoveTapFlickAsMove = value;
+    	savePrefsBooleanOption(PREFS_JAVA_UI_FLICK_AS_MOVE, value);
+    }
+
+    public static boolean brogueGetMoveTapFlickAsMove() {
+    	return mMoveTapFlickAsMove;
+    }
+
+    public void brogueSetMoveTapTouchAreasAsMove(boolean value) {
+    	mMoveTapTouchAreasAsMove = value;
+    	savePrefsBooleanOption(PREFS_JAVA_UI_TOUCH_AS_MOVE, value);
+    }
+
+    public static boolean brogueGetMoveTapTouchAreasAsMove() {
+    	return mMoveTapTouchAreasAsMove;
+    }
+
+    public void brogueSetMoveTapTouchAreaAsEnter(boolean value) {
+    	mMoveTapTouchAreaAsEnter = value;
+    	savePrefsBooleanOption(PREFS_JAVA_UI_TOUCH_AS_ENTER, value);
+    }
+
+    public static boolean brogueGetMoveTapTouchAreaAsEnter() {
+    	return mMoveTapTouchAreaAsEnter;
+    }
+
+    public void brogueSetMoveTapButtonAsEnter(boolean value) {
+    	mMoveTapButtonAsEnter = value;
+    	savePrefsBooleanOption(PREFS_JAVA_UI_BUTTON_AS_ENTER, value);
+    }
+
+    public static boolean brogueGetMoveTapButtonAsEnter() {
+    	return mMoveTapButtonAsEnter;
+    }
 
     private static String stripBrogueString(String text) {
     	int outIdx = 0, inIdx = 0, outIdxStart = -1, outIdxEnd = 0;
 	    	buttonIndex = 0;
 	    	window = null;
 		}
-
-        
         
         public BrogueMenuState(BrogueMenuState menuState) {
 			super();
 			}
     		
     		layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
-    			    		
+
+    		/* boolean isMainMenu = labels[0].equals("Explore") && labels[buttonCount-1].equals("Inventory"); */
+    		
     		for (int i = 0; i < buttonCount; i++) {
     			if (labels[i].length() == 0)
     				continue;
 						int idx = arg0.getId();
 						boolean controlPress = buttonMode == BROGUE_NG_NOTHING && labels[idx].endsWith(customGameLabel);
 						if (buttonMode == BROGUE_NG_NOTHING && hotkeys[idx] == 'q') {
+							/* Android applications cannot quit, are killed by OS when resources are needded */
 							Log.d("broguex", "quit hotkey");
 							SDLActivity.mSingleton.moveTaskToBack(true);
 							return;
     			layout.addView(button);
     		}
 
+    		if (buttonMode == BROGUE_NG_NEW_GAME || buttonMode == BROGUE_NG_NEW_GAME_WITH_SEED || buttonMode == BROGUE_NG_OPEN_GAME) {
+	    		if (SDLActivity.brogueGetMoveTapButtonAsEnter()) {
+	    			button = new Button(mSingleton);
+	    			button.setId(buttonCount);
+	    			button.setText("\u2713");
+		    		button.getBackground().setAlpha(alpha);
+	
+	    			button.setOnClickListener(new OnClickListener() {
+						public void onClick(View arg0) {
+				    		Log.i("broguex", "menu tap button enter");
+							//brogueEvents.add(new BrogueEvent(true, KeyEvent.KEYCODE_ENTER));
+							//brogueEvents.add(new BrogueEvent(false, KeyEvent.KEYCODE_ENTER));
+							/* We need to send one event to trigger the fallout. */
+					    	//dispatchNextBrogueEvent();
+					   	 	SDLActivity.onNativeKeyDown(KeyEvent.KEYCODE_ENTER);
+					        SDLActivity.onNativeKeyUp(KeyEvent.KEYCODE_ENTER);    	
+						}
+	    			});
+	    			
+	    			layout.addView(button);
+	    		}
+    		}
+
     		layout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
     		window = new PopupWindow(layout, layout.getMeasuredWidth(), layout.getMeasuredHeight());
     	    mSingleton.runOnUiThread(new java.lang.Runnable() {
     }
     
     public boolean SDL_onTouch(MotionEvent event) {
-        {
+    	{
              final int touchDevId = event.getDeviceId();
              final int pointerCount = event.getPointerCount();
              // touchId, pointerId, action, x, y, pressure
 		if (SDLActivity.brogueInAcknowledgeState) {
    			keyCode = KeyEvent.KEYCODE_SPACE;
 		} else if (x < 0.333f) {
-	   		if (y < 0.333f)			keyCode = CustomKeys.NUMPAD_7;
-	   		else if (y < 0.666f)	keyCode = CustomKeys.NUMPAD_4;
-	   		else					keyCode = CustomKeys.NUMPAD_1;
+			if (SDLActivity.brogueGetMoveTapTouchAreasAsMove()) {
+		   		if (y < 0.333f)			keyCode = CustomKeys.NUMPAD_7;
+		   		else if (y < 0.666f)	keyCode = CustomKeys.NUMPAD_4;
+		   		else					keyCode = CustomKeys.NUMPAD_1;
+			}
 	   	} else if (x < 0.666f) {
-	   		if (y < 0.333f)			keyCode = CustomKeys.NUMPAD_8;
-	   		else if (y < 0.666f)	keyCode = KeyEvent.KEYCODE_ENTER;
-	   		else					keyCode = CustomKeys.NUMPAD_2;
+	   		if (y < 0.333f) {
+				if (SDLActivity.brogueGetMoveTapTouchAreasAsMove())
+					keyCode = CustomKeys.NUMPAD_8;
+	   		} else if (y < 0.666f) {
+	   			if (SDLActivity.brogueGetMoveTapTouchAreaAsEnter())
+	   				keyCode = KeyEvent.KEYCODE_ENTER;
+	   		} else {
+				if (SDLActivity.brogueGetMoveTapTouchAreasAsMove())
+		   			keyCode = CustomKeys.NUMPAD_2;
+	   		}
 	   	} else {
-	   		if (y < 0.333f)			keyCode = CustomKeys.NUMPAD_9;
-	   		else if (y < 0.666f)	keyCode = CustomKeys.NUMPAD_6;
-	   		else					keyCode = CustomKeys.NUMPAD_3;
+			if (SDLActivity.brogueGetMoveTapTouchAreasAsMove()) {
+		   		if (y < 0.333f)			keyCode = CustomKeys.NUMPAD_9;
+		   		else if (y < 0.666f)	keyCode = CustomKeys.NUMPAD_6;
+		   		else					keyCode = CustomKeys.NUMPAD_3;
+			}
 	   	}
 
 	   	if (keyCode != 0) {
         }
     }
 
+	/* Move tap forwarded event for OnGestureListener. */
 	public boolean onDown(MotionEvent e) {
 		return false;
 	}
 
-	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
-			float velocityY) {
-		float x1, y1, x2, y2;
-		x1 = e1.getX() / mWidth;
-		y1 = e1.getY() / mHeight;
-		x2 = e2.getX() / mWidth;
-		y2 = e2.getY() / mHeight;
-		SDLActivity.nativeGestureFling(e1.getDeviceId(), x1, y1, x2, y2);
+	/* Move tap forwarded event for OnGestureListener. */
+	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
+		if (SDLActivity.brogueGetMoveTapFlickAsMove()) {
+	        int keyCode = 0;
+			float x1, y1, x2, y2;
+			x1 = e1.getX() / mWidth;
+			y1 = e1.getY() / mHeight;
+			x2 = e2.getX() / mWidth;
+			y2 = e2.getY() / mHeight;
+			float xd = x2 - x1;
+			float yd = y2 - y1;
+			if (Math.abs(yd) < 0.03f) { /* Horizontal movement */
+				if (xd > 0)
+					keyCode = CustomKeys.NUMPAD_6; /* Right */
+				else
+					keyCode = CustomKeys.NUMPAD_4; /* Left */
+			} else if (Math.abs(xd) < 0.03f) { /* Vertical movement */
+				if (yd > 0)
+					keyCode = CustomKeys.NUMPAD_2; /* Down */
+				else
+					keyCode = CustomKeys.NUMPAD_8; /* Up */
+			} else { /* Diagonal movement */
+				if (x2 > x1) { /* ?E */
+					if (y2 > y1)
+						keyCode = CustomKeys.NUMPAD_3; /* SE */
+					else
+						keyCode = CustomKeys.NUMPAD_9; /* NE */
+				} else { /* ?W */
+					if (y2 > y1)
+						keyCode = CustomKeys.NUMPAD_1; /* SW */
+					else
+						keyCode = CustomKeys.NUMPAD_7; /* NW */
+				}
+			}
+		   	if (keyCode != 0) {
+		   	 	SDLActivity.onNativeKeyDown(keyCode);
+		        SDLActivity.onNativeKeyUp(keyCode);    	
+		   	}
+		}
 		return false;
 	}
 
+	/* Move tap forwarded event for OnGestureListener. */
 	public void onLongPress(MotionEvent e) {
-		float x, y;
-		x = e.getX() / mWidth;
-		y = e.getY() / mHeight;		
-		SDLActivity.nativeGestureLongTouch(e.getDeviceId(), x, y);
+		if (SDLActivity.brogueGetMoveTapLongPressAsLMB()) {
+			float x, y;
+			x = e.getX() / mWidth;
+			y = e.getY() / mHeight;		
+			SDLActivity.nativeGestureLongTouch(e.getDeviceId(), x, y);
+		}
 	}
 
+	/* Move tap forwarded event for OnGestureListener. */
 	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
 		return false;
 	}
 
+	/* Move tap forwarded event for OnGestureListener. */
 	public void onShowPress(MotionEvent e) {
 	}
 
+	/* Move tap forwarded event for OnGestureListener. */
 	public boolean onSingleTapUp(MotionEvent e) {
         return SDL_onTouch(e);
 	}