From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/3] ui/curses: Fix pageup/pagedown on -curses
Date: Wed, 14 Oct 2015 20:37:31 +0900 [thread overview]
Message-ID: <877fmp8yv8.fsf_-_@mail.parknet.co.jp> (raw)
In-Reply-To: <87bnc18yvw.fsf_-_@mail.parknet.co.jp> (OGAWA Hirofumi's message of "Wed, 14 Oct 2015 20:37:07 +0900")
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>
---
ui/curses_keys.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff -puN ui/curses_keys.h~support-curses-pageup ui/curses_keys.h
--- qemu/ui/curses_keys.h~support-curses-pageup 2015-10-14 20:25:59.781822261 +0900
+++ qemu-hirofumi/ui/curses_keys.h 2015-10-14 20:25:59.785822255 +0900
@@ -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_KE
['\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_K
[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,
_
next prev parent reply other threads:[~2015-10-14 11:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 11:35 [Qemu-devel] [RFC 0/3] improve/fix -curses mode OGAWA Hirofumi
2015-10-14 11:36 ` [Qemu-devel] [PATCH 1/3] ui/curses: Fix monitor color with -curses when 256 colors OGAWA Hirofumi
2015-10-14 11:37 ` [Qemu-devel] [PATCH 2/3] ui/curses: Support line graphics chars on -curses mode OGAWA Hirofumi
2015-10-14 11:37 ` OGAWA Hirofumi [this message]
2015-10-14 14:04 ` Eric Blake
2015-10-14 15:44 ` Gerd Hoffmann
2015-10-14 23:58 ` OGAWA Hirofumi
2015-10-15 0:06 ` OGAWA Hirofumi
2015-10-15 0:07 ` [Qemu-devel] [PATCH v2 1/3] " OGAWA Hirofumi
2015-10-15 7:48 ` [Qemu-devel] [PATCH 2/3] " Gerd Hoffmann
2015-10-15 8:24 ` OGAWA Hirofumi
2015-10-15 8:50 ` OGAWA Hirofumi
2015-10-15 9:13 ` Gerd Hoffmann
2015-10-15 9:54 ` OGAWA Hirofumi
2015-10-15 9:54 ` [Qemu-devel] [PATCH v3] " OGAWA Hirofumi
2015-10-19 10:14 ` [Qemu-devel] [PATCH 2/3] " Gerd Hoffmann
2015-10-19 12:22 ` OGAWA Hirofumi
2015-10-15 9:14 ` Gerd Hoffmann
2015-10-15 9:58 ` OGAWA Hirofumi
2015-10-15 10:01 ` [Qemu-devel] [PATCH v4] " OGAWA Hirofumi
2015-10-14 16:46 ` [Qemu-devel] [RFC 0/3] improve/fix " Markus Armbruster
2015-10-14 23:59 ` OGAWA Hirofumi
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=877fmp8yv8.fsf_-_@mail.parknet.co.jp \
--to=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 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.