summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b52e7e0)
raw | patch | inline | side by side (parent: b52e7e0)
author | Kalle Wallin <kaw@linux.se> | |
Wed, 9 Jun 2004 17:17:31 +0000 (17:17 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Wed, 9 Jun 2004 17:17:31 +0000 (17:17 +0000) |
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 294f2318b603e6ff7f642a4630f454f9160336e2..81eec77f7c36f07e8fea50e928da0a1f77d2b9fa 100644 (file)
--- a/src/command.c
+++ b/src/command.c
N_("Key configuration screen") },
#endif
- { { 'q', 0, 0 }, CMD_QUIT, "quit",
+ { { 'q', 'Q', 3 }, CMD_QUIT, "quit",
N_("Quit") },
{ { -1, -1, -1 }, CMD_NONE, NULL, NULL }
return find_key_command(key, cmds);
}
-
command_t
-get_keyboard_command(void)
+get_keyboard_command_with_timeout(int ms)
{
int key;
+ if( ms != SCREEN_TIMEOUT)
+ timeout(ms);
key = wgetch(stdscr);
+ if( ms != SCREEN_TIMEOUT)
+ timeout(SCREEN_TIMEOUT);
if( key==KEY_RESIZE )
screen_resize();
if( key==ERR )
return CMD_NONE;
- DK(fprintf(stderr, "key = 0x%02X\t", key));
-
return get_key_command(key);
}
+command_t
+get_keyboard_command(void)
+{
+ return get_keyboard_command_with_timeout(SCREEN_TIMEOUT);
+}
+
int
assign_keys(command_t command, int keys[MAX_COMMAND_KEYS])
{
diff --git a/src/command.h b/src/command.h
index 9c20acb7a6bcfbd586de7b61e7e06b34201f08c2..9fd6ab37b853751a73fb561114ffdf2b8472851d 100644 (file)
--- a/src/command.h
+++ b/src/command.h
int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]);
command_t get_keyboard_command(void);
+command_t get_keyboard_command_with_timeout(int milliseconds);
#endif