input: handle more sequences #134

pull/138/head
nick black 5 years ago
parent 6e49bbce45
commit e1fb283018
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -166,7 +166,7 @@ wchar_supppuab_p(wchar_t w){
#define NCKEY_LEFT suppuabize(5)
#define NCKEY_INS suppuabize(6)
#define NCKEY_DEL suppuabize(7)
#define NCKEY_BS suppuabize(8) // backspace (sometimes)
#define NCKEY_BACKSPACE suppuabize(8) // backspace (sometimes)
#define NCKEY_PGDOWN suppuabize(9)
#define NCKEY_PGUP suppuabize(10)
#define NCKEY_HOME suppuabize(11)
@ -192,6 +192,14 @@ wchar_supppuab_p(wchar_t w){
#define NCKEY_F18 suppuabize(38)
#define NCKEY_F19 suppuabize(39)
#define NCKEY_F20 suppuabize(40)
// ... leave room for up to 100 function keys, egads
#define NCKEY_ENTER suppuabize(121)
#define NCKEY_CLS suppuabize(122) // "clear-screen or erase"
#define NCKEY_DLEFT suppuabize(123) // down + left on keypad
#define NCKEY_DRIGHT suppuabize(124)
#define NCKEY_ULEFT suppuabize(125) // up + left on keypad
#define NCKEY_URIGHT suppuabize(126)
#define NCKEY_CENTER suppuabize(127) // the most truly neutral of keypresses
// See ppoll(2) for more detail. Provide a NULL 'ts' to block at lenghth, a 'ts'
// of 0 for non-blocking operation, and otherwise a timespec to bound blocking.
@ -479,7 +487,9 @@ ncplane_putwstr_yx(struct ncplane* n, int y, int x, const wchar_t* gclustarr){
}
// The ncplane equivalents of printf(3) and vprintf(3).
API int ncplane_printf(struct ncplane* n, const char* format, ...);
API int ncplane_printf(struct ncplane* n, const char* format, ...)
__attribute__ ((format (printf, 2, 3)));
API int ncplane_vprintf(struct ncplane* n, const char* format, va_list ap);
static inline int

@ -224,7 +224,7 @@ int prep_special_keys(notcurses* nc){
{ .tinfo = "kcuu1", .key = NCKEY_UP, },
{ .tinfo = "kcud1", .key = NCKEY_DOWN, },
{ .tinfo = "kdch1", .key = NCKEY_DEL, },
{ .tinfo = "kbs", .key = NCKEY_BS, },
{ .tinfo = "kbs", .key = NCKEY_BACKSPACE, },
{ .tinfo = "kich1", .key = NCKEY_INS, },
{ .tinfo = "kend", .key = NCKEY_END, },
{ .tinfo = "khome", .key = NCKEY_HOME, },
@ -251,6 +251,13 @@ int prep_special_keys(notcurses* nc){
{ .tinfo = "kf18", .key = NCKEY_F18, },
{ .tinfo = "kf19", .key = NCKEY_F19, },
{ .tinfo = "kf20", .key = NCKEY_F20, },
{ .tinfo = "kent", .key = NCKEY_ENTER, },
{ .tinfo = "kclr", .key = NCKEY_CLS, },
{ .tinfo = "kc1", .key = NCKEY_DLEFT, },
{ .tinfo = "kc3", .key = NCKEY_DRIGHT, },
{ .tinfo = "ka1", .key = NCKEY_ULEFT, },
{ .tinfo = "ka3", .key = NCKEY_URIGHT, },
{ .tinfo = "kb2", .key = NCKEY_CENTER, },
{ .tinfo = NULL, .key = NCKEY_INVALID, }
}, *k;
for(k = keys ; k->tinfo ; ++k){

Loading…
Cancel
Save