summaryrefslogtreecommitdiff
path: root/clients/keyboard.c
diff options
context:
space:
mode:
authorJan Arne Petersen <jpetersen@openismus.com>2012-09-09 23:08:44 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-09-12 16:51:08 -0400
commite202bae9d3736341dc2d0c832797aaf45e1ef0b0 (patch)
treeb31cd3c5f11009449a7ca51a1b4ef894fdd139cb /clients/keyboard.c
parent43f4aa8cab93ae32e427ab8426261950d83f2755 (diff)
downloadweston-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.c4
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;