dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 7723dfbd2bbae15b125bcb316ed9671698a16a45
parent 892fa039ce87e559ab0a59112a349b7183bda26b
Author: Ross Mohn <rpmohn@waxandwane.org>
Date:   Sun, 16 Dec 2012 14:00:55 +0100

vt: correct mapping of keyboard function keys above F10

The way I think it should work is that PC keyboard keys F1 - F12 are
mapped to VT function keys F1 - F12 and shift+F1 - shift+F12 on the PC
keyboard are mapped to VT function keys F11 - F22. What this means is
that VT function keys F11 and F12 overlap and have two PC keyboard
mappings each, e.g. F11 and shift+F1 both map to VT F11.

In practice, terminal emulators seem to either implement both mappings,
or leave out the mappings for shift+F1 and shift+F2. The issue within
the curses/ncurses library, and therefor within dvtm, is that shift+F1
triggers KEY_F(13) which should then be mapped to the F11 escape
sequence, not the F13 escape sequence.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
vt.c | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/vt.c b/vt.c @@ -208,14 +208,16 @@ static char const * const keytable[KEY_MAX+1] = { [KEY_F(10)] = "\e[21~", [KEY_F(11)] = "\e[23~", [KEY_F(12)] = "\e[24~", - [KEY_F(13)] = "\e[25~", - [KEY_F(14)] = "\e[26~", - [KEY_F(15)] = "\e[28~", - [KEY_F(16)] = "\e[29~", - [KEY_F(17)] = "\e[31~", - [KEY_F(18)] = "\e[32~", - [KEY_F(19)] = "\e[33~", - [KEY_F(20)] = "\e[34~", + [KEY_F(13)] = "\e[23~", + [KEY_F(14)] = "\e[24~", + [KEY_F(15)] = "\e[25~", + [KEY_F(16)] = "\e[26~", + [KEY_F(17)] = "\e[28~", + [KEY_F(18)] = "\e[29~", + [KEY_F(19)] = "\e[31~", + [KEY_F(20)] = "\e[32~", + [KEY_F(21)] = "\e[33~", + [KEY_F(22)] = "\e[34~", [KEY_RESIZE] = "", };