editor: Add support for backspace keysym events

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen 12 years ago committed by Kristian Høgsberg
parent 8746ba0d29
commit 3fb6e71814
  1. 18
      clients/editor.c

@ -304,6 +304,24 @@ text_model_keysym(void *data,
return;
}
if (key == XKB_KEY_BackSpace) {
const char *start, *end;
text_entry_commit_and_reset(entry);
start = utf8_prev_char(entry->text, entry->text + entry->cursor);
if (start == NULL)
return;
end = utf8_end_char(entry->text + entry->cursor);
text_entry_delete_text(entry,
start - entry->text,
end - start);
return;
}
switch (key) {
case XKB_KEY_Tab:
key_label = "Tab";

Loading…
Cancel
Save