Static code for the special built-in key sequences

This commit is contained in:
Markus Gans 2020-04-29 02:24:48 +02:00
parent 4840978273
commit 0fd6439f5a
2 changed files with 8 additions and 6 deletions

View File

@ -206,11 +206,11 @@ FKeyMap fkey[] =
// 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
{ 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" }
};

View File

@ -231,7 +231,9 @@ void FTermcap::termcapKeys (char*& buffer)
// 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].string == nullptr && fc::fkey[i].tname[0] != 0;
i++ )
fc::fkey[i].string = tgetstr(C_STR(fc::fkey[i].tname), &buffer);
}