Static code for the special built-in key sequences

This commit is contained in:
Markus Gans 2020-04-29 00:37:29 +02:00
parent 1c3c687878
commit 4840978273
5 changed files with 211 additions and 291 deletions

View File

@ -1,5 +1,6 @@
2020-04-28 Markus Gans <guru.mail@muenster.de> 2020-04-28 Markus Gans <guru.mail@muenster.de>
* Adding the missing method getClientSize() * Adding the missing method getClientSize()
* Static code for the special built-in key sequences
2020-04-15 Markus Gans <guru.mail@muenster.de> 2020-04-15 Markus Gans <guru.mail@muenster.de>
* Better support of general arrow keys * Better support of general arrow keys

View File

@ -40,24 +40,14 @@ FKeyMap fkey[] =
{ fc::Fkey_dc , nullptr, "kDx"}, // keypad delete { fc::Fkey_dc , nullptr, "kDx"}, // keypad delete
{ fc::Fkey_dl , nullptr, "kL" }, // delete-line key { fc::Fkey_dl , nullptr, "kL" }, // delete-line key
{ fc::Fkey_down , nullptr, "kd" }, // down-arrow key { fc::Fkey_down , nullptr, "kd" }, // down-arrow key
{ fc::Fkey_down , nullptr, "kdx"}, // down-arrow key
{ fc::Fkey_down , nullptr, "kdX"}, // down-arrow key
{ fc::Fkey_eic , nullptr, "kM" }, // sent by rmir or smir in insert mode { fc::Fkey_eic , nullptr, "kM" }, // sent by rmir or smir in insert mode
{ fc::Fkey_eol , nullptr, "kE" }, // clear-to-end-of-line key { fc::Fkey_eol , nullptr, "kE" }, // clear-to-end-of-line key
{ fc::Fkey_eos , nullptr, "kS" }, // clear-to-end-of-screen key { fc::Fkey_eos , nullptr, "kS" }, // clear-to-end-of-screen key
{ fc::Fkey_f0 , nullptr, "k0" }, // F0 function key { fc::Fkey_f0 , nullptr, "k0" }, // F0 function key
{ fc::Fkey_f1 , nullptr, "k1" }, // F1 function key { fc::Fkey_f1 , nullptr, "k1" }, // F1 function key
{ fc::Fkey_f1 , nullptr, "k1x"}, // F1 function key
{ fc::Fkey_f1 , nullptr, "k1X"}, // F1 function key
{ fc::Fkey_f2 , nullptr, "k2" }, // F2 function key { fc::Fkey_f2 , nullptr, "k2" }, // F2 function key
{ fc::Fkey_f2 , nullptr, "k2x"}, // F2 function key
{ fc::Fkey_f2 , nullptr, "k2X"}, // F2 function key
{ fc::Fkey_f3 , nullptr, "k3" }, // F3 function key { fc::Fkey_f3 , nullptr, "k3" }, // F3 function key
{ fc::Fkey_f3 , nullptr, "k3x"}, // F3 function key
{ fc::Fkey_f3 , nullptr, "k3X"}, // F3 function key
{ fc::Fkey_f4 , nullptr, "k4" }, // F4 function key { fc::Fkey_f4 , nullptr, "k4" }, // F4 function key
{ fc::Fkey_f4 , nullptr, "k4x"}, // F4 function key
{ fc::Fkey_f4 , nullptr, "k4X"}, // F4 function key
{ fc::Fkey_f5 , nullptr, "k5" }, // F5 function key { fc::Fkey_f5 , nullptr, "k5" }, // F5 function key
{ fc::Fkey_f6 , nullptr, "k6" }, // F6 function key { fc::Fkey_f6 , nullptr, "k6" }, // F6 function key
{ fc::Fkey_f7 , nullptr, "k7" }, // F7 function key { fc::Fkey_f7 , nullptr, "k7" }, // F7 function key
@ -65,24 +55,17 @@ FKeyMap fkey[] =
{ fc::Fkey_f9 , nullptr, "k9" }, // F9 function key { fc::Fkey_f9 , nullptr, "k9" }, // F9 function key
{ fc::Fkey_f10 , nullptr, "k;" }, // F10 function key { fc::Fkey_f10 , nullptr, "k;" }, // F10 function key
{ fc::Fkey_home , nullptr, "kh" }, // home key { fc::Fkey_home , nullptr, "kh" }, // home key
{ fc::Fkey_home , nullptr, "khx"}, // home key
{ fc::Fkey_ic , nullptr, "kI" }, // insert-character key { fc::Fkey_ic , nullptr, "kI" }, // insert-character key
{ fc::Fkey_il , nullptr, "kA" }, // insert-line key { fc::Fkey_il , nullptr, "kA" }, // insert-line key
{ fc::Fkey_left , nullptr, "kl" }, // left-arrow key { fc::Fkey_left , nullptr, "kl" }, // left-arrow key
{ fc::Fkey_left , nullptr, "klx"}, // left-arrow key
{ fc::Fkey_left , nullptr, "klX"}, // left-arrow key
{ fc::Fkey_ll , nullptr, "kH" }, // last-line key { fc::Fkey_ll , nullptr, "kH" }, // last-line key
{ fc::Fkey_npage , nullptr, "kN" }, // next-page key { fc::Fkey_npage , nullptr, "kN" }, // next-page key
{ fc::Fkey_ppage , nullptr, "kP" }, // prev-page key { fc::Fkey_ppage , nullptr, "kP" }, // prev-page key
{ fc::Fkey_right , nullptr, "kr" }, // right-arrow key { fc::Fkey_right , nullptr, "kr" }, // right-arrow key
{ fc::Fkey_right , nullptr, "krx"}, // right-arrow key
{ fc::Fkey_right , nullptr, "krX"}, // right-arrow key
{ fc::Fkey_sf , nullptr, "kF" }, // scroll-forward key (shift-up) { fc::Fkey_sf , nullptr, "kF" }, // scroll-forward key (shift-up)
{ fc::Fkey_sr , nullptr, "kR" }, // scroll-backward key (shift-down) { fc::Fkey_sr , nullptr, "kR" }, // scroll-backward key (shift-down)
{ fc::Fkey_stab , nullptr, "kT" }, // set-tab key { fc::Fkey_stab , nullptr, "kT" }, // set-tab key
{ fc::Fkey_up , nullptr, "ku" }, // up-arrow key { fc::Fkey_up , nullptr, "ku" }, // up-arrow key
{ fc::Fkey_up , nullptr, "kux"}, // up-arrow key
{ fc::Fkey_up , nullptr, "kuX"}, // up-arrow key
{ fc::Fkey_a1 , nullptr, "K1" }, // upper left of keypad { fc::Fkey_a1 , nullptr, "K1" }, // upper left of keypad
{ fc::Fkey_a3 , nullptr, "K3" }, // upper right of keypad { fc::Fkey_a3 , nullptr, "K3" }, // upper right of keypad
{ fc::Fkey_b2 , nullptr, "K2" }, // center of keypad { fc::Fkey_b2 , nullptr, "K2" }, // center of keypad
@ -96,16 +79,9 @@ FKeyMap fkey[] =
{ fc::Fkey_copy , nullptr, "@5" }, // copy key { fc::Fkey_copy , nullptr, "@5" }, // copy key
{ fc::Fkey_create , nullptr, "@6" }, // create key { fc::Fkey_create , nullptr, "@6" }, // create key
{ fc::Fkey_end , nullptr, "@7" }, // end key { fc::Fkey_end , nullptr, "@7" }, // end key
{ fc::Fkey_end , nullptr, "@7x"}, // end key
{ fc::Fkey_end , nullptr, "@7X"}, // end key
{ fc::Fkey_enter , nullptr, "@8" }, // enter/send key { fc::Fkey_enter , nullptr, "@8" }, // enter/send key
{ fc::Fkey_enter , nullptr, "@8x"}, // enter/send key
{ fc::Fkey_exit , nullptr, "@9" }, // exit key { fc::Fkey_exit , nullptr, "@9" }, // exit key
{ fc::Fkey_find , nullptr, "@0" }, // find key { fc::Fkey_find , nullptr, "@0" }, // find key
{ fc::Fkey_slash , nullptr, "KP1"}, // keypad slash
{ fc::Fkey_asterisk , nullptr, "KP2"}, // keypad asterisk
{ fc::Fkey_minus_sign, nullptr, "KP3"}, // keypad minus sign
{ fc::Fkey_plus_sign , nullptr, "KP4"}, // keypad plus sign
{ fc::Fkey_help , nullptr, "%1" }, // help key { fc::Fkey_help , nullptr, "%1" }, // help key
{ fc::Fkey_mark , nullptr, "%2" }, // mark key { fc::Fkey_mark , nullptr, "%2" }, // mark key
{ fc::Fkey_message , nullptr, "%3" }, // message key { fc::Fkey_message , nullptr, "%3" }, // message key
@ -206,6 +182,35 @@ FKeyMap fkey[] =
{ fc::Fkey_f61 , nullptr, "Fp" }, // F61 function key { fc::Fkey_f61 , nullptr, "Fp" }, // F61 function key
{ fc::Fkey_f62 , nullptr, "Fq" }, // F62 function key { fc::Fkey_f62 , nullptr, "Fq" }, // F62 function key
{ fc::Fkey_f63 , nullptr, "Fr" }, // F63 function key { fc::Fkey_f63 , nullptr, "Fr" }, // F63 function key
// Some terminals (e.g. PuTTY) send vt100 key codes
// when the arrow and function keys are pressed
{ fc::Fkey_down , CSI "B", "kdx"}, // down-arrow key (standard mode)
{ fc::Fkey_down , ESC "OB", "kdX"}, // down-arrow key (application mode)
{ fc::Fkey_f1 , ESC "OP", "k1X"}, // PF1 (application mode)
{ fc::Fkey_f2 , ESC "OQ", "k2X"}, // PF2 (application mode)
{ fc::Fkey_f3 , ESC "OR", "k3X"}, // PF3 (application mode)
{ fc::Fkey_f4 , ESC "OS", "k4X"}, // PF4 (application mode)
{ fc::Fkey_left , CSI "D", "klx"}, // left-arrow key (standard mode)
{ fc::Fkey_left , ESC "OD", "klX"}, // left-arrow key (application mode)
{ fc::Fkey_right , CSI "C", "krx"}, // right-arrow key (standard mode)
{ fc::Fkey_right , ESC "OC", "krX"}, // right-arrow key (application mode)
{ fc::Fkey_up , CSI "A", "kux"}, // up-arrow key (standard mode)
{ fc::Fkey_up , ESC "OA", "kuX"}, // up-arrow key (application mode)
// Fallback for rxvt with TERM=xterm
{ fc::Fkey_home , CSI "7~", "khx"}, // home key
{ fc::Fkey_end , CSI "8~", "@7x"}, // end key
{ fc::Fkey_f1 , CSI "11~", "k1x"}, // F1 function key
{ fc::Fkey_f2 , CSI "12~", "k2x"}, // F2 function key
{ fc::Fkey_f3 , CSI "13~", "k3x"}, // F3 function key
{ fc::Fkey_f4 , CSI "14~", "k4x"}, // F4 function key
// Fallback for TERM=ansi
{ fc::Fkey_end , CSI "K", "@7X"}, // end key
// Keypad keys
{ fc::Fkey_enter , ESC "OM", "@8x"}, // enter key
{ fc::Fkey_slash , ESC "Oo", "KP1"}, // keypad slash
{ fc::Fkey_asterisk , ESC "Oj", "KP2"}, // keypad asterisk
{ fc::Fkey_minus_sign, ESC "Om", "KP3"}, // keypad minus sign
{ fc::Fkey_plus_sign , ESC "Ok", "KP4"}, // keypad plus sign
{ 0 , nullptr, "\0" } { 0 , nullptr, "\0" }
}; };

View File

@ -228,100 +228,11 @@ void FTermcap::termcapStrings (char*& buffer)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermcap::termcapKeys (char*& buffer) void FTermcap::termcapKeys (char*& buffer)
{ {
// Read termcap key strings // Get termcap keys
// Read termcap key sequences
for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++) for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++)
{
fc::fkey[i].string = tgetstr(C_STR(fc::fkey[i].tname), &buffer); fc::fkey[i].string = tgetstr(C_STR(fc::fkey[i].tname), &buffer);
// Fallback for rxvt with TERM=xterm
if ( std::strncmp(fc::fkey[i].tname, "khx", 3) == 0 )
fc::fkey[i].string = CSI "7~"; // Home key
if ( std::strncmp(fc::fkey[i].tname, "@7x", 3) == 0 )
fc::fkey[i].string = CSI "8~"; // End key
if ( std::strncmp(fc::fkey[i].tname, "k1x", 3) == 0 )
fc::fkey[i].string = CSI "11~"; // F1
if ( std::strncmp(fc::fkey[i].tname, "k2x", 3) == 0 )
fc::fkey[i].string = CSI "12~"; // F2
if ( std::strncmp(fc::fkey[i].tname, "k3x", 3) == 0 )
fc::fkey[i].string = CSI "13~"; // F3
if ( std::strncmp(fc::fkey[i].tname, "k4x", 3) == 0 )
fc::fkey[i].string = CSI "14~"; // F4
// Fallback for TERM=ansi
if ( std::strncmp(fc::fkey[i].tname, "@7X", 3) == 0 )
fc::fkey[i].string = CSI "K"; // End key
// Keypad keys
if ( std::strncmp(fc::fkey[i].tname, "@8x", 3) == 0 )
fc::fkey[i].string = ESC "OM"; // Enter key
if ( std::strncmp(fc::fkey[i].tname, "KP1", 3) == 0 )
fc::fkey[i].string = ESC "Oo"; // Keypad slash
if ( std::strncmp(fc::fkey[i].tname, "KP2", 3) == 0 )
fc::fkey[i].string = ESC "Oj"; // Keypad asterisk
if ( std::strncmp(fc::fkey[i].tname, "KP3", 3) == 0 )
fc::fkey[i].string = ESC "Om"; // Keypad minus sign
if ( std::strncmp(fc::fkey[i].tname, "KP4", 3) == 0 )
fc::fkey[i].string = ESC "Ok"; // Keypad plus sign
}
// VT100 key codes for the arrow and function keys
termcapKeysVt100();
}
//----------------------------------------------------------------------
void FTermcap::termcapKeysVt100()
{
// Some terminals (e.g. PuTTY) send vt100 key codes for
// the arrow and function keys.
for (std::size_t i{0}; fc::fkey[i].tname[0] != 0; i++)
{
if ( std::strncmp(fc::fkey[i].tname, "kux", 3) == 0 )
fc::fkey[i].string = CSI "A"; // Key up (standard mode)
if ( std::strncmp(fc::fkey[i].tname, "kuX", 3) == 0 )
fc::fkey[i].string = ESC "OA"; // Key up (application mode)
if ( std::strncmp(fc::fkey[i].tname, "kdx", 3) == 0 )
fc::fkey[i].string = CSI "B"; // Key down (standard mode)
if ( std::strncmp(fc::fkey[i].tname, "kdX", 3) == 0 )
fc::fkey[i].string = ESC "OB"; // Key down (application mode)
if ( std::strncmp(fc::fkey[i].tname, "krx", 3) == 0 )
fc::fkey[i].string = CSI "C"; // Key right (standard mode)
if ( std::strncmp(fc::fkey[i].tname, "krX", 3) == 0 )
fc::fkey[i].string = ESC "OC"; // Key right (application mode)
if ( std::strncmp(fc::fkey[i].tname, "klx", 3) == 0 )
fc::fkey[i].string = CSI "D"; // Key left (standard mode)
if ( std::strncmp(fc::fkey[i].tname, "klX", 3) == 0 )
fc::fkey[i].string = ESC "OD"; // Key left (application mode)
if ( std::strncmp(fc::fkey[i].tname, "k1X", 3) == 0 )
fc::fkey[i].string = ESC "OP"; // PF1 (application mode)
if ( std::strncmp(fc::fkey[i].tname, "k2X", 3) == 0 )
fc::fkey[i].string = ESC "OQ"; // PF2 (application mode)
if ( std::strncmp(fc::fkey[i].tname, "k3X", 3) == 0 )
fc::fkey[i].string = ESC "OR"; // PF3 (application mode)
if ( std::strncmp(fc::fkey[i].tname, "k4X", 3) == 0 )
fc::fkey[i].string = ESC "OS"; // PF4 (application mode)
}
} }

View File

@ -118,7 +118,6 @@ class FTermcap final
static void termcapNumerics(); static void termcapNumerics();
static void termcapStrings (char*&); static void termcapStrings (char*&);
static void termcapKeys (char*&); static void termcapKeys (char*&);
static void termcapKeysVt100();
// Data member // Data member
static FTermData* fterm_data; static FTermData* fterm_data;

View File

@ -52,24 +52,14 @@ FKeyMap fkey[] =
{ finalcut::fc::Fkey_dc , 0 , "kDx" }, // delete-character key { finalcut::fc::Fkey_dc , 0 , "kDx" }, // delete-character key
{ finalcut::fc::Fkey_dl , 0 , "kL" }, // delete-line key { finalcut::fc::Fkey_dl , 0 , "kL" }, // delete-line key
{ finalcut::fc::Fkey_down , ESC "OB" , "kd" }, // down-arrow key { finalcut::fc::Fkey_down , ESC "OB" , "kd" }, // down-arrow key
{ finalcut::fc::Fkey_down , CSI "B" , "kdx"}, // down-arrow key
{ finalcut::fc::Fkey_down , ESC "OB" , "kd" }, // down-arrow key
{ finalcut::fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode { finalcut::fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode
{ finalcut::fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key { finalcut::fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key
{ finalcut::fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key { finalcut::fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key
{ finalcut::fc::Fkey_f0 , 0 , "k0" }, // F0 function key { finalcut::fc::Fkey_f0 , 0 , "k0" }, // F0 function key
{ finalcut::fc::Fkey_f1 , ESC "OP" , "k1" }, // F1 function key { finalcut::fc::Fkey_f1 , ESC "OP" , "k1" }, // F1 function key
{ finalcut::fc::Fkey_f1 , CSI "11~" , "k1x"}, // F1 function key
{ finalcut::fc::Fkey_f1 , ESC "OP" , "k1X"}, // F1 function key
{ finalcut::fc::Fkey_f2 , ESC "OQ" , "k2" }, // F2 function key { finalcut::fc::Fkey_f2 , ESC "OQ" , "k2" }, // F2 function key
{ finalcut::fc::Fkey_f2 , CSI "12~" , "k2x"}, // F2 function key
{ finalcut::fc::Fkey_f2 , CSI "OQ" , "k2X"}, // F2 function key
{ finalcut::fc::Fkey_f3 , ESC "OR" , "k3" }, // F3 function key { finalcut::fc::Fkey_f3 , ESC "OR" , "k3" }, // F3 function key
{ finalcut::fc::Fkey_f3 , CSI "13~" , "k3x"}, // F3 function key
{ finalcut::fc::Fkey_f3 , ESC "OR" , "k3X"}, // F3 function key
{ finalcut::fc::Fkey_f4 , ESC "OS" , "k4" }, // F4 function key { finalcut::fc::Fkey_f4 , ESC "OS" , "k4" }, // F4 function key
{ finalcut::fc::Fkey_f4 , CSI "14~" , "k4x"}, // F4 function key
{ finalcut::fc::Fkey_f4 , ESC "OS" , "k4X"}, // F4 function key
{ finalcut::fc::Fkey_f5 , CSI "15~" , "k5" }, // F5 function key { finalcut::fc::Fkey_f5 , CSI "15~" , "k5" }, // F5 function key
{ finalcut::fc::Fkey_f6 , CSI "17~" , "k6" }, // F6 function key { finalcut::fc::Fkey_f6 , CSI "17~" , "k6" }, // F6 function key
{ finalcut::fc::Fkey_f7 , CSI "18~" , "k7" }, // F7 function key { finalcut::fc::Fkey_f7 , CSI "18~" , "k7" }, // F7 function key
@ -77,24 +67,17 @@ FKeyMap fkey[] =
{ finalcut::fc::Fkey_f9 , CSI "20~" , "k9" }, // F9 function key { finalcut::fc::Fkey_f9 , CSI "20~" , "k9" }, // F9 function key
{ finalcut::fc::Fkey_f10 , CSI "21~" , "k;" }, // F10 function key { finalcut::fc::Fkey_f10 , CSI "21~" , "k;" }, // F10 function key
{ finalcut::fc::Fkey_home , ESC "OH" , "kh" }, // home key { finalcut::fc::Fkey_home , ESC "OH" , "kh" }, // home key
{ finalcut::fc::Fkey_home , CSI "7~" , "khx"}, // home key
{ finalcut::fc::Fkey_ic , CSI "2~" , "kI" }, // insert-character key { finalcut::fc::Fkey_ic , CSI "2~" , "kI" }, // insert-character key
{ finalcut::fc::Fkey_il , 0 , "kA" }, // insert-line key { finalcut::fc::Fkey_il , 0 , "kA" }, // insert-line key
{ finalcut::fc::Fkey_left , ESC "OD" , "kl" }, // left-arrow key { finalcut::fc::Fkey_left , ESC "OD" , "kl" }, // left-arrow key
{ finalcut::fc::Fkey_left , CSI "D" , "klx"}, // left-arrow key
{ finalcut::fc::Fkey_left , ESC "OD" , "kl" }, // left-arrow key
{ finalcut::fc::Fkey_ll , 0 , "kH" }, // last-line key { finalcut::fc::Fkey_ll , 0 , "kH" }, // last-line key
{ finalcut::fc::Fkey_npage , CSI "6~" , "kN" }, // next-page key { finalcut::fc::Fkey_npage , CSI "6~" , "kN" }, // next-page key
{ finalcut::fc::Fkey_ppage , CSI "5~" , "kP" }, // prev-page key { finalcut::fc::Fkey_ppage , CSI "5~" , "kP" }, // prev-page key
{ finalcut::fc::Fkey_right , ESC "OC" , "kr" }, // right-arrow key { finalcut::fc::Fkey_right , ESC "OC" , "kr" }, // right-arrow key
{ finalcut::fc::Fkey_right , CSI "C" , "krx"}, // right-arrow key
{ finalcut::fc::Fkey_right , ESC "OC" , "kr" }, // right-arrow key
{ finalcut::fc::Fkey_sf , CSI "1;2B" , "kF" }, // scroll-forward key (shift-up) { finalcut::fc::Fkey_sf , CSI "1;2B" , "kF" }, // scroll-forward key (shift-up)
{ finalcut::fc::Fkey_sr , CSI "1;2A" , "kR" }, // scroll-backward key (shift-down) { finalcut::fc::Fkey_sr , CSI "1;2A" , "kR" }, // scroll-backward key (shift-down)
{ finalcut::fc::Fkey_stab , 0 , "kT" }, // set-tab key { finalcut::fc::Fkey_stab , 0 , "kT" }, // set-tab key
{ finalcut::fc::Fkey_up , ESC "OA" , "ku" }, // up-arrow key { finalcut::fc::Fkey_up , ESC "OA" , "ku" }, // up-arrow key
{ finalcut::fc::Fkey_up , CSI "A" , "kux"}, // up-arrow key
{ finalcut::fc::Fkey_up , ESC "OA" , "ku" }, // up-arrow key
{ finalcut::fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad { finalcut::fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad
{ finalcut::fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad { finalcut::fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad
{ finalcut::fc::Fkey_b2 , CSI "E" , "K2" }, // center of keypad { finalcut::fc::Fkey_b2 , CSI "E" , "K2" }, // center of keypad
@ -108,16 +91,9 @@ FKeyMap fkey[] =
{ finalcut::fc::Fkey_copy , 0 , "@5" }, // copy key { finalcut::fc::Fkey_copy , 0 , "@5" }, // copy key
{ finalcut::fc::Fkey_create , 0 , "@6" }, // create key { finalcut::fc::Fkey_create , 0 , "@6" }, // create key
{ finalcut::fc::Fkey_end , ESC "OF" , "@7" }, // end key { finalcut::fc::Fkey_end , ESC "OF" , "@7" }, // end key
{ finalcut::fc::Fkey_end , CSI "8~" , "@7x"}, // end key
{ finalcut::fc::Fkey_end , CSI "K" , "@7X"}, // end key
{ finalcut::fc::Fkey_enter , 0 , "@8" }, // enter/send key { finalcut::fc::Fkey_enter , 0 , "@8" }, // enter/send key
{ finalcut::fc::Fkey_enter , ESC "OM" , "@8x"}, // enter/send key
{ finalcut::fc::Fkey_exit , 0 , "@9" }, // exit key { finalcut::fc::Fkey_exit , 0 , "@9" }, // exit key
{ finalcut::fc::Fkey_find , CSI "1~" , "@0" }, // find key { finalcut::fc::Fkey_find , CSI "1~" , "@0" }, // find key
{ finalcut::fc::Fkey_slash , ESC "Oo" , "KP1"}, // keypad slash
{ finalcut::fc::Fkey_asterisk , ESC "Oj" , "KP2"}, // keypad asterisk
{ finalcut::fc::Fkey_minus_sign, ESC "Om" , "KP3"}, // keypad minus sign
{ finalcut::fc::Fkey_plus_sign , ESC "Ok" , "KP4"}, // keypad plus sign
{ finalcut::fc::Fkey_help , 0 , "%1" }, // help key { finalcut::fc::Fkey_help , 0 , "%1" }, // help key
{ finalcut::fc::Fkey_mark , 0 , "%2" }, // mark key { finalcut::fc::Fkey_mark , 0 , "%2" }, // mark key
{ finalcut::fc::Fkey_message , 0 , "%3" }, // message key { finalcut::fc::Fkey_message , 0 , "%3" }, // message key
@ -218,6 +194,34 @@ FKeyMap fkey[] =
{ finalcut::fc::Fkey_f61 , ESC "O1;4P", "Fp" }, // F61 function key { finalcut::fc::Fkey_f61 , ESC "O1;4P", "Fp" }, // F61 function key
{ finalcut::fc::Fkey_f62 , ESC "O1;4Q", "Fq" }, // F62 function key { finalcut::fc::Fkey_f62 , ESC "O1;4Q", "Fq" }, // F62 function key
{ finalcut::fc::Fkey_f63 , ESC "O1;4R", "Fr" }, // F63 function key { finalcut::fc::Fkey_f63 , ESC "O1;4R", "Fr" }, // F63 function key
// vt100 key codes for arrow and function keys
{ finalcut::fc::Fkey_down , CSI "B" , "kdx"}, // down-arrow key (standard mode)
{ finalcut::fc::Fkey_down , ESC "OB" , "kdX"}, // down-arrow key (application mode)
{ finalcut::fc::Fkey_f1 , ESC "OP" , "k1X"}, // PF1 (application mode)
{ finalcut::fc::Fkey_f2 , CSI "OQ" , "k2X"}, // PF2 (application mode)
{ finalcut::fc::Fkey_f3 , ESC "OR" , "k3X"}, // PF3 (application mode)
{ finalcut::fc::Fkey_f4 , ESC "OS" , "k4X"}, // PF4 (application mode)
{ finalcut::fc::Fkey_left , CSI "D" , "klx"}, // left-arrow key (standard mode)
{ finalcut::fc::Fkey_left , ESC "OD" , "klX"}, // left-arrow key (application mode)
{ finalcut::fc::Fkey_right , CSI "C" , "krx"}, // right-arrow key (standard mode)
{ finalcut::fc::Fkey_right , ESC "OC" , "krX"}, // right-arrow key (application mode)
{ finalcut::fc::Fkey_up , CSI "A" , "kux"}, // up-arrow key (standard mode)
{ finalcut::fc::Fkey_up , ESC "OA" , "kuX"}, // up-arrow key (application mode)
// Fallback for rxvt with TERM=xterm
{ finalcut::fc::Fkey_home , CSI "7~" , "khx"}, // home key
{ finalcut::fc::Fkey_end , CSI "8~" , "@7x"}, // end key
{ finalcut::fc::Fkey_f1 , CSI "11~" , "k1x"}, // F1 function key
{ finalcut::fc::Fkey_f2 , CSI "12~" , "k2x"}, // F2 function key
{ finalcut::fc::Fkey_f3 , CSI "13~" , "k3x"}, // F3 function key
{ finalcut::fc::Fkey_f4 , CSI "14~" , "k4x"}, // F4 function key
// Fallback for TERM=ansi
{ finalcut::fc::Fkey_end , CSI "K" , "@7X"}, // end key
// Keypad keys
{ finalcut::fc::Fkey_enter , ESC "OM" , "@8x"}, // enter key
{ finalcut::fc::Fkey_slash , ESC "Oo" , "KP1"}, // keypad slash
{ finalcut::fc::Fkey_asterisk , ESC "Oj" , "KP2"}, // keypad asterisk
{ finalcut::fc::Fkey_minus_sign, ESC "Om" , "KP3"}, // keypad minus sign
{ finalcut::fc::Fkey_plus_sign , ESC "Ok" , "KP4"}, // keypad plus sign
{ 0 , 0 , "\0" } { 0 , 0 , "\0" }
}; };