summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/textinput.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/desktop/textinput.c b/desktop/textinput.c
index 36daa374d..4b3d0b6ac 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -127,18 +127,8 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
assert(bw->window != NULL);
- if (focus->caret_callback) {
- /* Pass keypress onto anything that has claimed input focus */
- return focus->caret_callback(focus, key,
- focus->caret_p1, focus->caret_p2);
- }
-
- /* keys that take effect wherever the caret is positioned */
+ /* safe keys that can be handled whether input claimed or not */
switch (key) {
- case KEY_SELECT_ALL:
- selection_select_all(bw->cur_sel);
- return true;
-
case KEY_COPY_SELECTION:
gui_copy_to_clipboard(bw->cur_sel);
return true;
@@ -157,6 +147,19 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
return false;
}
+ if (focus->caret_callback) {
+ /* Pass keypress onto anything that has claimed input focus */
+ return focus->caret_callback(focus, key,
+ focus->caret_p1, focus->caret_p2);
+ }
+
+ /* keys we can't handle here if cursor is in form */
+ switch (key) {
+ case KEY_SELECT_ALL:
+ selection_select_all(bw->cur_sel);
+ return true;
+ }
+
return false;
}