Skip to content

Commit 2479f96

Browse files
committed
[notcurses] handle alt cursor
1 parent c646f54 commit 2479f96

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/third-party/notcurses/src/lib/in.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ prep_xtmodkeys(inputctx* ictx){
163163
.modifiers = NCKEY_MOD_CTRL, },
164164
{ .esc = "\x1b[6S", .key = NCKEY_F04,
165165
.modifiers = NCKEY_MOD_CTRL | NCKEY_MOD_SHIFT, },
166+
167+
{ .esc = "\033b", .key = NCKEY_LEFT,
168+
.modifiers = NCKEY_MOD_ALT },
169+
{ .esc = "\033f", .key = NCKEY_RIGHT,
170+
.modifiers = NCKEY_MOD_ALT },
171+
172+
166173
{ .esc = NULL, .key = 0, },
167174
}, *k;
168175
for(k = keys ; k->esc ; ++k){

src/vt52_curses.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ vt52_curses::map_input(const ncinput& ch)
143143
return string_fragment::from_c_str(&this->vc_map_buffer);
144144
}
145145

146-
if ((ncinput_shift_p(&ch) || ncinput_ctrl_p(&ch) || ncinput_alt_p(&ch))
146+
if ((ncinput_shift_p(&ch) || ncinput_ctrl_p(&ch) || ncinput_alt_p(&ch)
147+
|| ncinput_meta_p(&ch))
147148
&& ch.id == NCKEY_LEFT)
148149
{
149150
return string_fragment::from_const("\033b");
150151
}
151152

152-
if ((ncinput_shift_p(&ch) || ncinput_ctrl_p(&ch) || ncinput_alt_p(&ch))
153+
if ((ncinput_shift_p(&ch) || ncinput_ctrl_p(&ch) || ncinput_alt_p(&ch)
154+
|| ncinput_meta_p(&ch))
153155
&& ch.id == NCKEY_RIGHT)
154156
{
155157
return string_fragment::from_const("\033f");

0 commit comments

Comments
 (0)