aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-04-11 15:42:06 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-04-11 15:42:06 -0700
commitc4c4a898e5856bda4857834845d9f92a97271233 (patch)
tree21bc9a1fc4d88c298768a06b6a48e6699925fe21 /com32/samples
parenteb27a41b4ad733a53efd576534426334b389d2ae (diff)
downloadsyslinux-c4c4a898e5856bda4857834845d9f92a97271233.tar.gz
syslinux-c4c4a898e5856bda4857834845d9f92a97271233.tar.xz
syslinux-c4c4a898e5856bda4857834845d9f92a97271233.zip
keytest: make somewhat more comprehensible
Someone may very well need to use keytest to figure out their keymappings. Make it a bit more user friendly. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32/samples')
-rw-r--r--com32/samples/keytest.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/com32/samples/keytest.c b/com32/samples/keytest.c
index a5cdd5c1..09c041a1 100644
--- a/com32/samples/keytest.c
+++ b/com32/samples/keytest.c
@@ -37,7 +37,7 @@ static void cooked_keys(void)
if (key == 0x03) {
printf("[done]\n");
exit(0);
- } else if (key == '?')
+ } else if (key == '!')
return;
if (key >= 0x20 && key < 0x100) {
@@ -63,7 +63,8 @@ static void raw_keys(void)
} else if (key == '!')
return;
- printf("<%02x>", key);
+ if (key != EOF)
+ printf("<%02x>", key);
}
}
@@ -72,7 +73,7 @@ int main(void)
console_ansi_raw();
printf("CLK_TCK = %d\n", (int)CLK_TCK);
- printf("Press keys, end with Ctrl-C...\n");
+ printf("Press keys, end with Ctrl-C, ! changes from cooked to raw\n");
for (;;) {
cooked_keys();