Skip to contentSkip to conversation

Fix curses return key when using -k

PATCH Applied Samuel Thibault 2 participants 3 messages Feb 28, 2010 – Mar 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix curses return key when using -k

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

curses_keys.h +1 -1
index a6e41cf..6030720 100644
@@ -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 },
#1 lore raw
Quoted 4 lines · 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.

Quoted 15 lines

Samuel

curses_keys.h +1 -1
index a6e41cf..6030720 100644
@@ -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 },
Signature · 4 lines
Samuel
 jr> J'ai fait.
 Ne bougez pas, l'aide soignante va venir nettoyer.
 -+- FF in GNU - Le vieil homme et la merde -+-
#2 lore raw
In reply to Samuel Thibault
Quoted 6 lines · Samuel Thibault

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