diff options
author | Jan Arne Petersen <jpetersen@openismus.com> | 2012-09-09 23:08:44 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-09-12 16:51:08 -0400 |
commit | e202bae9d3736341dc2d0c832797aaf45e1ef0b0 (patch) | |
tree | b31cd3c5f11009449a7ca51a1b4ef894fdd139cb /clients/keyboard.c | |
parent | 43f4aa8cab93ae32e427ab8426261950d83f2755 (diff) | |
download | weston-e202bae9d3736341dc2d0c832797aaf45e1ef0b0.tar.gz weston-e202bae9d3736341dc2d0c832797aaf45e1ef0b0.tar.bz2 weston-e202bae9d3736341dc2d0c832797aaf45e1ef0b0.zip |
text: Add delete_surrounding_text to protocol
Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Diffstat (limited to 'clients/keyboard.c')
-rw-r--r-- | clients/keyboard.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clients/keyboard.c b/clients/keyboard.c index 4bc7d240..588ef785 100644 --- a/clients/keyboard.c +++ b/clients/keyboard.c @@ -222,6 +222,10 @@ keyboard_handle_key(struct keyboard *keyboard, const struct key *key) strlen(keyboard->keyboard->preedit_string)); break; case keytype_backspace: + if (strlen(keyboard->keyboard->preedit_string) == 0) { + input_method_context_delete_surrounding_text(keyboard->keyboard->context, + -1, 1); + } break; case keytype_enter: break; |