All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] allow shift-pageup and shift-pagedown for scrolling in text consoles
Date: Tue, 13 Feb 2007 15:46:20 +0000	[thread overview]
Message-ID: <20070213154620.GA8409@miranda.arrow> (raw)

[-- 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);
 

                 reply	other threads:[~2007-02-13 15:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070213154620.GA8409@miranda.arrow \
    --to=sdbrady@ntlworld.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.