All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Reduce curses escdelay from 1s to 0.2s
@ 2016-06-22 15:44 Samuel Thibault
  2016-06-22 20:49 ` Peter Maydell
  0 siblings, 1 reply; 11+ messages in thread
From: Samuel Thibault @ 2016-06-22 15:44 UTC (permalink / raw)
  To: qemu-devel, kraxel; +Cc: Samuel Thibault

By default, curses will only report single ESC key event after 1s delay,
since ESC is also used for keypad escape sequences. This however makes users
believe that ESC is not working. Reducing to 0.2s provides good enough user
experience, while still allowing 200ms for keypad sequences to get in, which
should be more than enough.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 ui/curses.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/curses.c b/ui/curses.c
index b475589..49d3ce6 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -222,7 +222,7 @@ static void curses_refresh(DisplayChangeListener *dcl)
         keycode = curses2keycode[chr];
         keycode_alt = 0;
 
-        /* alt key */
+        /* alt or esc key */
         if (keycode == 1) {
             nextchr = getch();
 
@@ -349,6 +349,7 @@ static void curses_setup(void)
     initscr(); noecho(); intrflush(stdscr, FALSE);
     nodelay(stdscr, TRUE); nonl(); keypad(stdscr, TRUE);
     start_color(); raw(); scrollok(stdscr, FALSE);
+    set_escdelay(200);
 
     /* Make color pair to match color format (3bits bg:3bits fg) */
     for (i = 0; i < 64; i++) {
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH] Reduce curses escdelay from 1s to 0.2s
@ 2016-10-30 11:38 Samuel Thibault
  0 siblings, 0 replies; 11+ messages in thread
From: Samuel Thibault @ 2016-10-30 11:38 UTC (permalink / raw)
  To: qemu-devel, kraxel

By default, curses will only report single ESC key event after 1s delay,
since ESC is also used for keypad escape sequences. This however makes users
believe that ESC is not working. Reducing to 0.2s provides good enough user
experience, while still allowing 200ms for keypad sequences to get in, which
should be more than enough.

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

---
rebased on master

diff --git a/ui/curses.c b/ui/curses.c
index 2e132a7..3599295 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -216,7 +216,7 @@ static void curses_refresh(DisplayChangeListener *dcl)
         keycode = curses2keycode[chr];
         keycode_alt = 0;
 
-        /* alt key */
+        /* alt or esc key */
         if (keycode == 1) {
             int nextchr = getch();
 
@@ -345,6 +345,7 @@ static void curses_setup(void)
     initscr(); noecho(); intrflush(stdscr, FALSE);
     nodelay(stdscr, TRUE); nonl(); keypad(stdscr, TRUE);
     start_color(); raw(); scrollok(stdscr, FALSE);
+    set_escdelay(200);
 
     /* Make color pair to match color format (3bits bg:3bits fg) */
     for (i = 0; i < 64; i++) {

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH] Reduce curses escdelay from 1s to 0.2s
@ 2019-03-03  6:14 Samuel Thibault
  2019-03-03 17:11 ` Warner Losh
  0 siblings, 1 reply; 11+ messages in thread
From: Samuel Thibault @ 2019-03-03  6:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Samuel Thibault, Gerd Hoffmann

By default, curses will only report single ESC key event after 1s delay,
since ESC is also used for keypad escape sequences. This however makes users
believe that ESC is not working. Reducing to 0.2s provides good enough user
experience, while still allowing 200ms for keypad sequences to get in, which
should be more than enough.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 ui/curses.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/curses.c b/ui/curses.c
index 6e0091c3b2..700315bc09 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -231,7 +231,7 @@ static void curses_refresh(DisplayChangeListener *dcl)
         keycode = curses2keycode[chr];
         keycode_alt = 0;
 
-        /* alt key */
+        /* alt or esc key */
         if (keycode == 1) {
             int nextchr = getch();
 
@@ -361,6 +361,7 @@ static void curses_setup(void)
     initscr(); noecho(); intrflush(stdscr, FALSE);
     nodelay(stdscr, TRUE); nonl(); keypad(stdscr, TRUE);
     start_color(); raw(); scrollok(stdscr, FALSE);
+    set_escdelay(200);
 
     /* Make color pair to match color format (3bits bg:3bits fg) */
     for (i = 0; i < 64; i++) {
-- 
2.20.1

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

end of thread, other threads:[~2019-03-03 17:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 15:44 [Qemu-devel] [PATCH] Reduce curses escdelay from 1s to 0.2s Samuel Thibault
2016-06-22 20:49 ` Peter Maydell
2016-06-22 21:06   ` Samuel Thibault
2016-06-22 21:11     ` Peter Maydell
2016-10-15 17:24   ` Samuel Thibault
2016-10-26 12:51     ` Gerd Hoffmann
2016-10-26 15:20       ` Samuel Thibault
2016-10-30 11:38 Samuel Thibault
2019-03-03  6:14 Samuel Thibault
2019-03-03 17:11 ` Warner Losh
2019-03-03 17:26   ` Samuel Thibault

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.