aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2011-05-24 15:27:49 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2011-05-24 15:27:49 +0200
commit3b42b5e49b687837d4ffeabdd6fae207202afb1c (patch)
treef8a735ad68a1fb500e3a44d7be5c315dd0d207d8
parentdf51b2fe4486032edca1e8f64e4ab61c668e8691 (diff)
downloadpowerdebug-3b42b5e49b687837d4ffeabdd6fae207202afb1c.tar.gz
make the keyscan code human readable
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--powerdebug.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/powerdebug.c b/powerdebug.c
index 3e0272f..dd4fe91 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -164,10 +164,10 @@ int keystroke_callback(bool *enter_hit, bool *findparent_ncurses,
if (keystroke == EOF)
exit(0);
- if (keystroke == KEY_RIGHT || keystroke == 9)
+ if (keystroke == KEY_RIGHT || keystroke == '\t')
options->selectedwindow++;
- if (keystroke == KEY_LEFT || keystroke == 353)
+ if (keystroke == KEY_LEFT || keystroke == KEY_BTAB)
options->selectedwindow--;
if (options->selectedwindow >= TOTAL_FEATURE_WINS)
@@ -181,20 +181,20 @@ int keystroke_callback(bool *enter_hit, bool *findparent_ncurses,
highlighted_row++;
if (keystroke == KEY_UP && highlighted_row > 0)
highlighted_row--;
- if (keystroke == 47)
+ if (keystroke == '/')
*findparent_ncurses = true;
- if ((keystroke == 27 || oldselectedwin !=
+ if ((keystroke == '\e' || oldselectedwin !=
options->selectedwindow) && *findparent_ncurses) {
*findparent_ncurses = false;
clkname_str[0] = '\0';
}
- if (*findparent_ncurses && keystroke != 13) {
+ if (*findparent_ncurses && keystroke != '\r') {
int len = strlen(clkname_str);
char str[2];
- if (keystroke == 263) {
+ if (keystroke == KEY_BACKSPACE) {
if (len > 0)
len--;
@@ -220,7 +220,7 @@ int keystroke_callback(bool *enter_hit, bool *findparent_ncurses,
exit(1);
#endif
- if (keystroke == 13)
+ if (keystroke == '\r')
*enter_hit = true;
if (keychar == 'Q' && !*findparent_ncurses)