diff mbox

Fix curses return key when using -k

Message ID 20100228143519.GM11637@const.famille.thibault.fr
State New
Headers show

Commit Message

Samuel Thibault Feb. 28, 2010, 2:35 p.m. UTC
Hello,

There is a small incoherency in curses_keys.h, which makes it fail to
emit \n when using e.g. -k fr: curses2keysym transforms \r and 0x157
into \n, but name2keysym binds \r with Return, not \n.  The patch below
fixes that.

Samuel

Comments

Samuel Thibault Feb. 28, 2010, 5:06 p.m. UTC | #1
Samuel Thibault, le Sun 28 Feb 2010 15:35:19 +0100, a écrit :
> There is a small incoherency in curses_keys.h, which makes it fail to
> emit \n when using e.g. -k fr: curses2keysym transforms \r and 0x157
> into \n, but name2keysym binds \r with Return, not \n.  The patch below
> fixes that.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> Samuel
> 
> diff --git a/curses_keys.h b/curses_keys.h
> index a6e41cf..6030720 100644
> --- a/curses_keys.h
> +++ b/curses_keys.h
> @@ -446,7 +446,7 @@ static const name2keysym_t name2keysym[] = {
>      /* Special keys */
>      { "BackSpace", 0x07f },
>      { "Tab", '\t' },
> -    { "Return", '\r' },
> +    { "Return", '\n' },
>      { "Right", 0x105 },
>      { "Left", 0x104 },
>      { "Up", 0x103 },
andrzej zaborowski March 2, 2010, 11:16 p.m. UTC | #2
On 28 February 2010 15:35, Samuel Thibault <samuel.thibault@gnu.org> wrote:
> Hello,
>
> There is a small incoherency in curses_keys.h, which makes it fail to
> emit \n when using e.g. -k fr: curses2keysym transforms \r and 0x157
> into \n, but name2keysym binds \r with Return, not \n.  The patch below
> fixes that.

Thanks, applied both patches.

Cheers
diff mbox

Patch

diff --git a/curses_keys.h b/curses_keys.h
index a6e41cf..6030720 100644
--- a/curses_keys.h
+++ b/curses_keys.h
@@ -446,7 +446,7 @@  static const name2keysym_t name2keysym[] = {
     /* Special keys */
     { "BackSpace", 0x07f },
     { "Tab", '\t' },
-    { "Return", '\r' },
+    { "Return", '\n' },
     { "Right", 0x105 },
     { "Left", 0x104 },
     { "Up", 0x103 },