qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATH,curses] Fix control-{@[\]^_} and ESC
@ 2010-08-29 23:23 Samuel Thibault
  2010-10-19 17:48 ` [Qemu-devel] Re: [PATCH,curses] " Samuel Thibault
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2010-08-29 23:23 UTC (permalink / raw)
  To: qemu-devel

control-{@[\]^_} shouldn't get the 'a' - 'A' offset for correct
translation. ESC is better simulated as escape key.

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

diff --git a/ui/curses.c b/ui/curses.c
index ed3165e..5d949d6 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -238,9 +240,12 @@ static void curses_refresh(DisplayState *ds)
                 keysym = curses2keysym[chr];
 
             if (keysym == -1) {
-                if (chr < ' ')
-                    keysym = (chr + '@' - 'A' + 'a') | KEYSYM_CNTRL;
-                else
+                if (chr < ' ') {
+                    keysym = chr + '@';
+                    if (keysym >= 'A' && keysym <= 'Z')
+                        keysym += 'a' - 'A';
+                    keysym |= KEYSYM_CNTRL;
+                } else
                     keysym = chr;
             }
 
diff --git a/ui/curses_keys.h b/ui/curses_keys.h
index 1decd11..c0d5eb4 100644
--- a/ui/curses_keys.h
+++ b/ui/curses_keys.h
@@ -55,6 +55,7 @@ static const int curses2keysym[CURSES_KEYS] = {
     [0x7f] = KEY_BACKSPACE,
     ['\r'] = KEY_ENTER,
     ['\n'] = KEY_ENTER,
+    [27] = 27,
     [KEY_BTAB] = '\t' | KEYSYM_SHIFT,
 };
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH,curses] Fix control-{@[\]^_} and ESC
  2010-08-29 23:23 [Qemu-devel] [PATH,curses] Fix control-{@[\]^_} and ESC Samuel Thibault
@ 2010-10-19 17:48 ` Samuel Thibault
  2010-10-21 16:26   ` andrzej zaborowski
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2010-10-19 17:48 UTC (permalink / raw)
  To: qemu-devel

Hello,

This apparently has been neither applied, nor commented on.  Could
either be done?

Samuel



control-{@[\]^_} shouldn't get the 'a' - 'A' offset for correct
translation. ESC is better simulated as escape key.

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

diff --git a/ui/curses.c b/ui/curses.c
index ed3165e..5d949d6 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -238,9 +240,12 @@ static void curses_refresh(DisplayState *ds)
                 keysym = curses2keysym[chr];
 
             if (keysym == -1) {
-                if (chr < ' ')
-                    keysym = (chr + '@' - 'A' + 'a') | KEYSYM_CNTRL;
-                else
+                if (chr < ' ') {
+                    keysym = chr + '@';
+                    if (keysym >= 'A' && keysym <= 'Z')
+                        keysym += 'a' - 'A';
+                    keysym |= KEYSYM_CNTRL;
+                } else
                     keysym = chr;
             }
 
diff --git a/ui/curses_keys.h b/ui/curses_keys.h
index 1decd11..c0d5eb4 100644
--- a/ui/curses_keys.h
+++ b/ui/curses_keys.h
@@ -55,6 +55,7 @@ static const int curses2keysym[CURSES_KEYS] = {
     [0x7f] = KEY_BACKSPACE,
     ['\r'] = KEY_ENTER,
     ['\n'] = KEY_ENTER,
+    [27] = 27,
     [KEY_BTAB] = '\t' | KEYSYM_SHIFT,
 };
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Re: [PATCH,curses] Fix control-{@[\]^_} and ESC
  2010-10-19 17:48 ` [Qemu-devel] Re: [PATCH,curses] " Samuel Thibault
@ 2010-10-21 16:26   ` andrzej zaborowski
  0 siblings, 0 replies; 3+ messages in thread
From: andrzej zaborowski @ 2010-10-21 16:26 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: qemu-devel

On 19 October 2010 19:48, Samuel Thibault <samuel.thibault@gnu.org> wrote:
> Hello,
>
> This apparently has been neither applied, nor commented on.  Could
> either be done?

Thanks, pushed the patch and sorry for missing the email the first time.

Cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-21 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-29 23:23 [Qemu-devel] [PATH,curses] Fix control-{@[\]^_} and ESC Samuel Thibault
2010-10-19 17:48 ` [Qemu-devel] Re: [PATCH,curses] " Samuel Thibault
2010-10-21 16:26   ` andrzej zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).