summaryrefslogtreecommitdiff
path: root/xev.c
diff options
context:
space:
mode:
authorGoblin <xorg-nospam@uukgoblin.net>2022-02-18 22:20:07 +0000
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-02-20 09:36:03 -0800
commiteedd0fed999e515618816ca831b8de3b3011c993 (patch)
tree1ae673ed30837bd43c77eb768dabbe1de005f1fc /xev.c
parentad23b1e9f4463017f76534300925aa08c055df48 (diff)
xev: fix KeymapNotify event printing
When xev prints the KeymapNotify event (after the user brings the xev window into focus), it incorrectly displays unsigned char values >= 128. For instance, 128 is printed as 42949667168. This can be seen for instance by holding the '6' key (which has the keycode 15) and then bringing the xev window into focus. Observe the KeymapNotify event, the second number after "keys: " will be 42949667168. If you instead hold the '5' key (which has the keycode 14), you'll see 64 there, as expected. No-one seems to have noticed since at least the last millenium ;-) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xev.c')
-rw-r--r--xev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xev.c b/xev.c
index ea69234..de4e6e8 100644
--- a/xev.c
+++ b/xev.c
@@ -420,7 +420,7 @@ do_KeymapNotify(XEvent *eventp)
if (i == 16 && !single_line) {
output(InitialNewLine | Indent, " ");
}
- output(0, "%-3u ", (unsigned int) e->key_vector[i]);
+ output(0, "%-3u ", (unsigned char) e->key_vector[i]);
}
output_new_line();
}