summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-10-09 11:19:30 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-10-09 11:19:30 +0200
commit0a03785ffc4811979fd8a6e4f62bd02eee5656b6 (patch)
tree7db550d55968b70365037154892c9e3e8dd2ea9f /src/terminal.c
parentfba4b9104bd333923dcc3094e91b808b1663b4e7 (diff)
uterm: input: add support for multiple keysyms
xkbcommon supports reporting multiple keysyms per key-event. There is no keymap which uses this, yet. However, this feature is not meant to enhance performance by reducing the number of calls into xkb, but instead multiple keysyms are to be handled as one big keysym. But there are no examples, yet, so we cannot actually perform any conversions on them. But we can add the infrastructure for it. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/terminal.c b/src/terminal.c
index fa513bf..e8f6f24 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -359,36 +359,42 @@ static void input_event(struct uterm_input *input,
return;
if (UTERM_INPUT_HAS_MODS(ev, kmscon_conf.grab_scroll_up->mods) &&
- ev->keysym == kmscon_conf.grab_scroll_up->keysym) {
+ ev->keysyms[0] == kmscon_conf.grab_scroll_up->keysym) {
tsm_screen_sb_up(term->console, 1);
schedule_redraw(term);
ev->handled = true;
return;
}
if (UTERM_INPUT_HAS_MODS(ev, kmscon_conf.grab_scroll_down->mods) &&
- ev->keysym == kmscon_conf.grab_scroll_down->keysym) {
+ ev->keysyms[0] == kmscon_conf.grab_scroll_down->keysym) {
tsm_screen_sb_down(term->console, 1);
schedule_redraw(term);
ev->handled = true;
return;
}
if (UTERM_INPUT_HAS_MODS(ev, kmscon_conf.grab_page_up->mods) &&
- ev->keysym == kmscon_conf.grab_page_up->keysym) {
+ ev->keysyms[0] == kmscon_conf.grab_page_up->keysym) {
tsm_screen_sb_page_up(term->console, 1);
schedule_redraw(term);
ev->handled = true;
return;
}
if (UTERM_INPUT_HAS_MODS(ev, kmscon_conf.grab_page_down->mods) &&
- ev->keysym == kmscon_conf.grab_page_down->keysym) {
+ ev->keysyms[0] == kmscon_conf.grab_page_down->keysym) {
tsm_screen_sb_page_down(term->console, 1);
schedule_redraw(term);
ev->handled = true;
return;
}
- if (tsm_vte_handle_keyboard(term->vte, ev->keysym, ev->mods,
- ev->unicode)) {
+ /* TODO: xkbcommon supports multiple keysyms, but it is currently
+ * unclear how this feature will be used. There is no keymap, which
+ * uses this, yet. */
+ if (ev->num_syms > 1)
+ return;
+
+ if (tsm_vte_handle_keyboard(term->vte, ev->keysyms[0], ev->mods,
+ ev->codepoints[0])) {
tsm_screen_sb_reset(term->console);
schedule_redraw(term);
ev->handled = true;