Received: from eggs.gnu.org ([2001:4830:134:3::10]:55152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmKNF-0004lG-L2 for qemu-devel@nongnu.org; Wed, 14 Oct 2015 07:37:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmKNB-0004Cs-DY for qemu-devel@nongnu.org; Wed, 14 Oct 2015 07:37:37 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:48005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmKNB-0004Ce-57 for qemu-devel@nongnu.org; Wed, 14 Oct 2015 07:37:33 -0400 Received: from ibmpc.myhome.or.jp (unknown [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTP id 77F261E0049 for ; Wed, 14 Oct 2015 20:37:32 +0900 (JST) Received: from devron.myhome.or.jp (root@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.14.9/8.14.9/Debian-4) with ESMTP id t9EBbVe0007993 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 14 Oct 2015 20:37:32 +0900 Received: from devron.myhome.or.jp (hirofumi@localhost [127.0.0.1]) by devron.myhome.or.jp (8.14.9/8.14.9/Debian-4) with ESMTP id t9EBbVgr021761 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 14 Oct 2015 20:37:31 +0900 From: OGAWA Hirofumi References: <87k2qp8yxv.fsf@mail.parknet.co.jp> <87fv1d8ywp.fsf@mail.parknet.co.jp> <87bnc18yvw.fsf_-_@mail.parknet.co.jp> Date: Wed, 14 Oct 2015 20:37:31 +0900 In-Reply-To: <87bnc18yvw.fsf_-_@mail.parknet.co.jp> (OGAWA Hirofumi's message of "Wed, 14 Oct 2015 20:37:07 +0900") Message-ID: <877fmp8yv8.fsf_-_@mail.parknet.co.jp> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 3/3] ui/curses: Fix pageup/pagedown on -curses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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, _