diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-06 22:39:45 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-02-06 22:39:45 +0000 |
commit | 762e1aad733c4d56edbb85c7b21b0951d8f759f2 (patch) | |
tree | 71305c5b65e055c907be507b6242285842bea72f /desktop/textinput.c | |
parent | 008cdb42d718ed1e1e61c9c16e6aa22bc345d202 (diff) | |
download | netsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.gz netsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.bz2 |
First pass at getting html forms to use textarea widget.
(Input element types text & password, and textarea element.)
Can edit and submit forms, but there are loads of issues.
Diffstat (limited to 'desktop/textinput.c')
-rw-r--r-- | desktop/textinput.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/desktop/textinput.c b/desktop/textinput.c index b4fda5eef..660708932 100644 --- a/desktop/textinput.c +++ b/desktop/textinput.c @@ -127,7 +127,13 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key) assert(bw->window != NULL); - /* safe keys that can be handled whether input claimed or not */ + 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); + } + + /* TODO: pass these to content to deal with */ switch (key) { case KEY_COPY_SELECTION: selection_copy_to_clipboard(bw->cur_sel); @@ -137,6 +143,10 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key) selection_clear(bw->cur_sel, true); return true; + case KEY_SELECT_ALL: + selection_select_all(bw->cur_sel); + return true; + case KEY_ESCAPE: if (bw->cur_sel && selection_defined(bw->cur_sel)) { selection_clear(bw->cur_sel, true); @@ -147,19 +157,6 @@ 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; } |