Don't pass already handled keys to the URL Complete code.

Don't scroll browser windows when the toolbar has focus.

svn path=/trunk/netsurf/; revision=13157
This commit is contained in:
Steve Fryatt 2011-11-20 18:38:33 +00:00
parent 98378081a7
commit 747c66c982
2 changed files with 8 additions and 8 deletions

View File

@ -1153,6 +1153,12 @@ bool ro_toolbar_keypress(wimp_key *key)
if (toolbar == NULL)
return false;
/* Pass the keypress on to the client and stop if they handle it. */
if (toolbar->callbacks->key_press != NULL &&
toolbar->callbacks->key_press(toolbar->client_data, key))
return true;
/* If the caret is in the URL bar, ask the URL Complete module if it
* wants to handle the keypress.
*
@ -1166,11 +1172,6 @@ bool ro_toolbar_keypress(wimp_key *key)
ro_gui_url_complete_keypress(toolbar, key->c))
return true;
/* Otherwsie, pass the keypress on to the client. */
if (toolbar->callbacks->key_press != NULL)
return toolbar->callbacks->key_press(toolbar->client_data, key);
return false;
}

View File

@ -2036,9 +2036,6 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
case IS_WIMP_KEY | wimp_KEY_RIGHT:
case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_LEFT:
case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_RIGHT:
if (is_toolbar)
return false;
break;
case IS_WIMP_KEY + wimp_KEY_UP:
case IS_WIMP_KEY + wimp_KEY_DOWN:
case IS_WIMP_KEY + wimp_KEY_PAGE_UP:
@ -2046,6 +2043,8 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
case wimp_KEY_HOME:
case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_UP:
case IS_WIMP_KEY + wimp_KEY_END:
if (is_toolbar)
return false;
break;
default:
return false; /* This catches any keys we don't want to claim */