From 633c83de2c8d96837a702ee9264aaeb3b7c65230 Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Mon, 17 Sep 2012 15:28:08 +0200 Subject: [PATCH] keyboard: Allow backspace for pre-edit text When there is a pre-edit text delete the last character of the pre-edit text with the backspace key. --- clients/keyboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clients/keyboard.c b/clients/keyboard.c index bf0e9f03..8820a22a 100644 --- a/clients/keyboard.c +++ b/clients/keyboard.c @@ -233,6 +233,11 @@ keyboard_handle_key(struct keyboard *keyboard, const struct key *key) if (strlen(keyboard->keyboard->preedit_string) == 0) { input_method_context_delete_surrounding_text(keyboard->keyboard->context, -1, 1); + } else { + keyboard->keyboard->preedit_string[strlen(keyboard->keyboard->preedit_string) - 1] = '\0'; + input_method_context_preedit_string(keyboard->keyboard->context, + keyboard->keyboard->preedit_string, + strlen(keyboard->keyboard->preedit_string)); } break; case keytype_enter: