diff options
author | Steve Fryatt <steve@stevefryatt.org.uk> | 2011-11-20 18:38:33 +0000 |
---|---|---|
committer | Steve Fryatt <steve@stevefryatt.org.uk> | 2011-11-20 18:38:33 +0000 |
commit | 747c66c982cd36979e17d2b845f93559a9d5affd (patch) | |
tree | 528496fe301e1ebcb6964f4ccf91ac9f7ef10cd2 | |
parent | 98378081a78922e191b4c71a8a39a90eba70d99c (diff) | |
download | netsurf-747c66c982cd36979e17d2b845f93559a9d5affd.tar.gz netsurf-747c66c982cd36979e17d2b845f93559a9d5affd.tar.bz2 |
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
-rw-r--r-- | riscos/toolbar.c | 11 | ||||
-rw-r--r-- | riscos/window.c | 5 |
2 files changed, 8 insertions, 8 deletions
diff --git a/riscos/toolbar.c b/riscos/toolbar.c index 73823394f..96bd5a8d7 100644 --- a/riscos/toolbar.c +++ b/riscos/toolbar.c @@ -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; } diff --git a/riscos/window.c b/riscos/window.c index 34c70fb01..0479fc82b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -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 */ |