[PATCH v2 12/28] editor: Only delete on backspace key released

Jan Arne Petersen jpetersen at openismus.com
Thu Apr 18 07:47:26 PDT 2013


From: Jan Arne Petersen <jpetersen at openismus.com>

Do not delete two characters when key is pressed and released.

Signed-off-by: Jan Arne Petersen <jpetersen at openismus.com>
---
 clients/editor.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clients/editor.c b/clients/editor.c
index 027b562..e686248 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -327,6 +327,9 @@ text_input_keysym(void *data,
 	if (key == XKB_KEY_BackSpace) {
 		const char *start, *end;
 
+		if (state != WL_KEYBOARD_KEY_STATE_RELEASED)
+			return;
+
 		text_entry_commit_and_reset(entry);
 
 		start = utf8_prev_char(entry->text, entry->text + entry->cursor);
-- 
1.8.1.4



More information about the wayland-devel mailing list