From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Subject: [Qemu-devel] [PULL 3/6] ui/curses: Fix pageup/pagedown on -curses
Date: Tue, 3 Nov 2015 11:01:28 +0100 [thread overview]
Message-ID: <1446544891-3600-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1446544891-3600-1-git-send-email-kraxel@redhat.com>
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Current KEY_NPAGE/KEY_PPAGE handling is broken on -curses. Those uses
"GREY", but "KEY_MASK" masked out "GREY".
To fix, we have to use correct mask value - SCANCODE_KEYMASK.
Then, this adds support of "shift + pageup/pagedown". With this,
-curses mode can use scroll-up/down as usual like other display modes.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/curses_keys.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ui/curses_keys.h b/ui/curses_keys.h
index 18ce6dc..f746744 100644
--- a/ui/curses_keys.h
+++ b/ui/curses_keys.h
@@ -29,8 +29,7 @@
#include "keymaps.h"
-#define KEY_RELEASE 0x80
-#define KEY_MASK 0x7f
+#define KEY_MASK SCANCODE_KEYMASK
#define GREY_CODE 0xe0
#define GREY SCANCODE_GREY
#define SHIFT_CODE 0x2a
@@ -60,6 +59,8 @@ static const int curses2keysym[CURSES_KEYS] = {
['\n'] = KEY_ENTER,
[27] = 27,
[KEY_BTAB] = '\t' | KEYSYM_SHIFT,
+ [KEY_SPREVIOUS] = KEY_PPAGE | KEYSYM_SHIFT,
+ [KEY_SNEXT] = KEY_NPAGE | KEYSYM_SHIFT,
};
static const int curses2keycode[CURSES_KEYS] = {
@@ -149,6 +150,9 @@ static const int curses2keycode[CURSES_KEYS] = {
[KEY_IC] = 82 | GREY, /* Insert */
[KEY_DC] = 83 | GREY, /* Delete */
+ [KEY_SPREVIOUS] = 73 | GREY | SHIFT, /* Shift + Page Up */
+ [KEY_SNEXT] = 81 | GREY | SHIFT, /* Shift + Page Down */
+
['!'] = 2 | SHIFT,
['@'] = 3 | SHIFT,
['#'] = 4 | SHIFT,
--
1.8.3.1
next prev parent reply other threads:[~2015-11-03 10:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 10:01 [Qemu-devel] [PULL 0/6] ui patch queue Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 1/6] ui/curses: Fix monitor color with -curses when 256 colors Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 2/6] ui/curses: Support line graphics chars on -curses mode Gerd Hoffmann
2015-11-03 10:01 ` Gerd Hoffmann [this message]
2015-11-03 10:01 ` [Qemu-devel] [PULL 4/6] ui/opengl: Reduce build required libraries for opengl Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 5/6] vnc: allow fall back to RAW encoding Gerd Hoffmann
2015-11-03 10:01 ` [Qemu-devel] [PULL 6/6] vnc: fix bug: vnc server can't start when 'to' is specified Gerd Hoffmann
2015-11-05 8:21 ` Markus Armbruster
2015-11-03 11:17 ` [Qemu-devel] [PULL 0/6] ui patch queue Peter Maydell
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=1446544891-3600-4-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=hirofumi@mail.parknet.co.jp \
--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 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).