All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH 1/2] Use symbolic instead of numeric constants for keys
Date: Mon, 20 May 2013 16:25:32 +0300	[thread overview]
Message-ID: <20130520132532.GA2238@swordfish> (raw)
In-Reply-To: 1368979243-3175-2-git-send-email-hpdeifel@gmx.de

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

On (05/19/13 18:00), Hans-Peter Deifel wrote:
> This improves the readability of the key handling code.
> 
> Since there is no symbolic constant for Escape, a comment with an
> explanation is added.
> 
> Signed-off-by: Hans-Peter Deifel <hpdeifel(a)gmx.de>
> ---

looks good, thanks.

	-ss

>  src/main.cpp | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/main.cpp b/src/main.cpp
> index 0883424..46466b0 100644
> --- a/src/main.cpp
> +++ b/src/main.cpp
> @@ -136,10 +136,10 @@ static void do_sleep(int seconds)
>  
>  		c = getch();
>  		switch (c) {
> -		case 353: 
> +		case KEY_BTAB:
>  			show_prev_tab();
>  			break;
> -		case 9:
> +		case '\t':
>  			show_next_tab(); 
>  			break;
>  		case KEY_RIGHT:
> @@ -156,8 +156,8 @@ static void do_sleep(int seconds)
>  		case KEY_UP:
>  			cursor_up();
>  			break;
> -		case 32:
> -		case 10:
> +		case ' ':
> +		case '\n':
>  			cursor_enter();
>  			break;
>  		case 's':
> @@ -169,7 +169,7 @@ static void do_sleep(int seconds)
>  			return;
>  		case KEY_EXIT:
>  		case 'q':
> -		case 27:
> +		case 27:	// Escape
>  			leave_powertop = 1;
>  			return;
>  		}
> -- 
> 1.8.1.5
> 
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
> 

             reply	other threads:[~2013-05-20 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 13:25 Sergey Senozhatsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-20 10:43 [Powertop] [PATCH 1/2] Use symbolic instead of numeric constants for keys Paul Menzel
2013-05-19 16:00 Hans-Peter Deifel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130520132532.GA2238@swordfish \
    --to=powertop@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.