Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-14 Thread Rob Landley
I'm waiting or you to get to a good stopping point, then I can factor common code out into lib/. Rob On 4/14/19 2:06 AM, Jarno Mäkipää wrote: > vi does not necessarily need so many function keys in order to be usable.  > Mostly escape, and  30 or so different control key commands in order to > im

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-14 Thread Jarno Mäkipää
vi does not necessarily need so many function keys in order to be usable. Mostly escape, and 30 or so different control key commands in order to implement everything on man page. But I think after vi has all the basic functionality done, things like utf-8 and handling of text buffer, could be reu

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-12 Thread Rob Landley
On 4/12/19 8:58 PM, David Seikel wrote: > I presume you meant to send this to the list. Yup. > On Fri, 12 Apr 2019 15:52:10 -0500 Rob Landley wrote: > >> On 4/11/19 9:46 PM, David Seikel wrote: > luckily i suspect in 2019 we mainly want function keys just so we > can throw them away and

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-12 Thread David Seikel
I presume you meant to send this to the list. On Fri, 12 Apr 2019 15:52:10 -0500 Rob Landley wrote: > On 4/11/19 9:46 PM, David Seikel wrote: > >>> luckily i suspect in 2019 we mainly want function keys just so we > >>> can throw them away and get on to the next meaningful keypress! > >>> but i

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-11 Thread David Seikel
> > luckily i suspect in 2019 we mainly want function keys just so we > > can throw them away and get on to the next meaningful keypress! but > > i can easily put this back to one constant per key if you prefer. > > Unfortunately a command line utility doesn't get to _see_ the > function keys, s

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-11 Thread Rob Landley
On 4/11/19 10:55 AM, enh wrote: > On Sat, Mar 23, 2019 at 4:11 PM Rob Landley wrote: >> >> On 3/23/19 2:44 PM, enh via Toybox wrote: >>> Although we can get away with ignoring termcap/terminfo on the output >>> side by restricting ourselves to generally-supported escape sequences, >> >> There's do

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-04-11 Thread enh via Toybox
On Sat, Mar 23, 2019 at 4:11 PM Rob Landley wrote: > > On 3/23/19 2:44 PM, enh via Toybox wrote: > > Although we can get away with ignoring termcap/terminfo on the output > > side by restricting ourselves to generally-supported escape sequences, > > There's documentation on this, by the way: > > h

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-03-23 Thread Rob Landley
On 3/23/19 2:44 PM, enh via Toybox wrote: > Although we can get away with ignoring termcap/terminfo on the output > side by restricting ourselves to generally-supported escape sequences, There's documentation on this, by the way: http://man7.org/linux/man-pages/man4/console_codes.4.html I have a

Re: [Toybox] [PATCH] scan_key: support more terminals.

2019-03-23 Thread Rob Landley
On 3/23/19 2:44 PM, enh via Toybox wrote: > Since we can't use TAGGED_ARRAY for this (without inflicting pain on all > the callers) I've also switched to OR-ing in the modifier keys, so we > have (say) KEY_UP|KEY_SHIFT rather than a separate KEY_SUP. This also > generalizes better should we ever ne

[Toybox] [PATCH] scan_key: support more terminals.

2019-03-23 Thread enh via Toybox
Although we can get away with ignoring termcap/terminfo on the output side by restricting ourselves to generally-supported escape sequences, the input side is trickier because we need to support the sequences sent by common terminals. Luckily, this isn't is as bad as it sounds because only Home/End