qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] allow shift-pageup and shift-pagedown for scrolling in text consoles
@ 2007-02-13 15:46 Stuart Brady
  0 siblings, 0 replies; only message in thread
From: Stuart Brady @ 2007-02-13 15:46 UTC (permalink / raw)
  To: qemu-devel

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

Hello,

I've attached a patch that allows shift-pageup and shift-pagedown to be
used for scrolling in text consoles.  Some users are surprised that they
have to use ctrl-pageup and ctrl-pagedown instead.

Obviously this does affect all text consoles, and not just the monitor.

I added a separate QEMU_KEY_SHIFT_PAGEUP and QEMU_KEY_SHIFT_PAGEDOWN,
but I'm not sure if I should have renamed QEMU_KEY_CTRL_PAGEUP and
QEMU_KEY_CTRL_PAGEDOWN instead.

It also fixes a minor fomatting problem in the same code.

Does it look okay?

Cheers,
-- 
Stuart Brady

[-- Attachment #2: shift.diff --]
[-- Type: text/plain, Size: 2712 bytes --]

Index: console.c
===================================================================
RCS file: /sources/qemu/qemu/console.c,v
retrieving revision 1.12
diff -u -r1.12 console.c
--- console.c	10 Feb 2007 22:37:56 -0000	1.12
+++ console.c	13 Feb 2007 15:30:49 -0000
@@ -1078,6 +1078,12 @@
     case QEMU_KEY_CTRL_PAGEDOWN:
         console_scroll(10);
         break;
+    case QEMU_KEY_SHIFT_PAGEUP:
+        console_scroll(-10);
+        break;
+    case QEMU_KEY_SHIFT_PAGEDOWN:
+        console_scroll(10);
+        break;
     default:
         /* convert the QEMU keysym to VT100 key string */
         q = buf;
Index: sdl.c
===================================================================
RCS file: /sources/qemu/qemu/sdl.c,v
retrieving revision 1.34
diff -u -r1.34 sdl.c
--- sdl.c	24 Jan 2007 21:40:21 -0000	1.34
+++ sdl.c	13 Feb 2007 15:30:49 -0000
@@ -366,6 +366,12 @@
                         case SDLK_PAGEDOWN: keysym = QEMU_KEY_CTRL_PAGEDOWN; break;
                         default: break;
                         }
+                    } else if (ev->key.keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT)) {
+                        switch(ev->key.keysym.sym) {
+                        case SDLK_PAGEUP: keysym = QEMU_KEY_SHIFT_PAGEUP; break;
+                        case SDLK_PAGEDOWN: keysym = QEMU_KEY_SHIFT_PAGEDOWN; break;
+                        default: break;
+                        }
                     } else {
                         switch(ev->key.keysym.sym) {
                         case SDLK_UP: keysym = QEMU_KEY_UP; break;
@@ -376,7 +382,8 @@
                         case SDLK_END: keysym = QEMU_KEY_END; break;
                         case SDLK_PAGEUP: keysym = QEMU_KEY_PAGEUP; break;
                         case SDLK_PAGEDOWN: keysym = QEMU_KEY_PAGEDOWN; break;
-                        case SDLK_BACKSPACE: keysym = QEMU_KEY_BACKSPACE; break;                        case SDLK_DELETE: keysym = QEMU_KEY_DELETE; break;
+                        case SDLK_BACKSPACE: keysym = QEMU_KEY_BACKSPACE; break;
+                        case SDLK_DELETE: keysym = QEMU_KEY_DELETE; break;
                         default: break;
                         }
                     }
Index: vl.h
===================================================================
RCS file: /sources/qemu/qemu/vl.h,v
retrieving revision 1.185
diff -u -r1.185 vl.h
--- vl.h	8 Feb 2007 23:09:59 -0000	1.185
+++ vl.h	13 Feb 2007 15:30:49 -0000
@@ -226,6 +226,8 @@
 #define QEMU_KEY_CTRL_END        0xe405
 #define QEMU_KEY_CTRL_PAGEUP     0xe406
 #define QEMU_KEY_CTRL_PAGEDOWN   0xe407
+#define QEMU_KEY_SHIFT_PAGEUP    0xe408
+#define QEMU_KEY_SHIFT_PAGEDOWN  0xe409
 
 void kbd_put_keysym(int keysym);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-13 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-13 15:46 [Qemu-devel] [PATCH] allow shift-pageup and shift-pagedown for scrolling in text consoles Stuart Brady

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).