Anonymous avatar Anonymous committed 20a804a

EXT-2262 Arrow keys should move cursor in chat entry field.
See Communications Spec for design. Arrow keys still move you if text chat field
is empty. Also fixed ctrl-up/ctrl-down for recently chatted lines.
Reviewed with Richard.

Comments (0)

Files changed (3)

indra/newview/app_settings/settings.xml

       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>ArrowKeysMoveAvatar</key>
+    <key>ArrowKeysAlwaysMove</key>
     <map>
       <key>Comment</key>
       <string>While cursor is in chat entry box, arrow keys still control your avatar</string>
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
     <key>AskedAboutCrashReports</key>
     <map>

indra/newview/llviewerwindow.cpp

 		// arrow keys move avatar while chatting hack
 		if (chat_editor && chat_editor->hasFocus())
 		{
-			if (chat_editor->getText().empty() || gSavedSettings.getBOOL("ArrowKeysMoveAvatar"))
+			// let Control-Up and Control-Down through for chat line history
+			if (!(key == KEY_UP && mask == MASK_CONTROL)
+				&& !(key == KEY_DOWN && mask == MASK_CONTROL))
 			{
-				switch(key)
+				// If text field is empty, there's no point in trying to move
+				// cursor with arrow keys, so allow movement
+				if (chat_editor->getText().empty() 
+					|| gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
 				{
-				case KEY_LEFT:
-				case KEY_RIGHT:
-				case KEY_UP:
-					// let CTRL UP through for chat line history
-					if( MASK_CONTROL == mask )
+					switch(key)
 					{
+					case KEY_LEFT:
+					case KEY_RIGHT:
+					case KEY_UP:
+					case KEY_DOWN:
+					case KEY_PAGE_UP:
+					case KEY_PAGE_DOWN:
+					case KEY_HOME:
+						// when chatbar is empty or ArrowKeysAlwaysMove set,
+						// pass arrow keys on to avatar...
+						return FALSE;
+					default:
 						break;
 					}
-				case KEY_DOWN:
-					// let CTRL DOWN through for chat line history
-					if( MASK_CONTROL == mask )
-					{
-						break;
-					}
-				case KEY_PAGE_UP:
-				case KEY_PAGE_DOWN:
-				case KEY_HOME:
-					// when chatbar is empty or ArrowKeysMoveAvatar set, pass arrow keys on to avatar...
-					return FALSE;
-				default:
-					break;
 				}
 			}
 		}

indra/newview/skins/default/xui/en/panel_preferences_advanced.xml

      width="256"
      top_pad="0"/>
     <check_box
-     control_name="ArrowKeysMoveAvatar"
+     control_name="ArrowKeysAlwaysMove"
      follows="left|top"
      height="20"
      label="Arrow keys always move me"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.