From patchwork Thu Jun 16 20:29:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 1988 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D768C23E54 for ; Thu, 16 Jun 2011 20:31:44 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id A657AA18905 for ; Thu, 16 Jun 2011 20:31:44 +0000 (UTC) Received: by vxk12 with SMTP id 12so2092663vxk.11 for ; Thu, 16 Jun 2011 13:31:44 -0700 (PDT) Received: by 10.52.98.97 with SMTP id eh1mr1964981vdb.7.1308256304178; Thu, 16 Jun 2011 13:31:44 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs211201vdc; Thu, 16 Jun 2011 13:31:43 -0700 (PDT) Received: by 10.216.144.166 with SMTP id n38mr1385839wej.75.1308256301736; Thu, 16 Jun 2011 13:31:41 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by mx.google.com with ESMTP id b12si5059081wed.125.2011.06.16.13.31.41; Thu, 16 Jun 2011 13:31:41 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.130 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.130; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.130 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([92.134.76.78]) by mwinf5d16 with ME id wkXf1g0031hMfSL03kXgJP; Thu, 16 Jun 2011 22:31:41 +0200 From: Daniel Lezcano To: patches@linaro.org Subject: [PATCH 04/28] make the keyscan code human readable Date: Thu, 16 Jun 2011 22:29:33 +0200 Message-Id: <1308256197-29155-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308256197-29155-1-git-send-email-daniel.lezcano@linaro.org> References: <1308256197-29155-1-git-send-email-daniel.lezcano@linaro.org> Signed-off-by: Daniel Lezcano --- powerdebug.c | 14 +++++++------- 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)