|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From fe741a85c1912ead26c1a78251e1d490a8a432b3 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Fri, 3 Oct 2014 12:48:36 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal/idev: don't map XKB_KEY_NoSymbol as ASCII 0
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
XKB_KEY_NoSymbol is defined as 0 but does not correspond to a VT key with
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
ASCII value 0. No such key exists, so don't try to find such a key.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/idev-keyboard.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/idev-keyboard.c b/src/libsystemd-terminal/idev-keyboard.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index d5936b7d23..8dc1c20b14 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/idev-keyboard.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/idev-keyboard.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -575,7 +575,7 @@ static int8_t guess_ascii(struct xkb_state *state, uint32_t code, uint32_t n_sym
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const xkb_keysym_t *s;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
int num;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (n_syms == 1 && syms[0] < 128)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (n_syms == 1 && syms[0] < 128 && syms[0] > 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return syms[0];
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
keymap = xkb_state_get_keymap(state);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -584,7 +584,7 @@ static int8_t guess_ascii(struct xkb_state *state, uint32_t code, uint32_t n_sym
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
for (lo = 0; lo < n_lo; ++lo) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
lv = xkb_state_key_get_level(state, code + KBDXKB_SHIFT, lo);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
num = xkb_keymap_key_get_syms_by_level(keymap, code + KBDXKB_SHIFT, lo, lv, &s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (num == 1 && s[0] < 128)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (num == 1 && s[0] < 128 && s[0] > 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return s[0];
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|