Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: mnemonic 'ENTER' with zcurses



On Sun, Jan 7, 2024, at 8:08 PM, Ray Andrews wrote:
> On 2024-01-07 16:50, Bart Schaefer wrote:
>
>> I'm not an expert on this, but I believe in this case ENTER means the key on the keypad, 
> What we used to call the grey keys.  Yup, that returns ENTER. So 
> they're unique here.  Ok then, no mnemonic for '\n' then.  Seems like 
> an omission but it is what it is.

The man page you linked covers this.

	Some keys may be the same as commonly used control keys,
	e.g., KEY_ENTER versus control/M, KEY_BACKSPACE versus
	control/H.  Some curses implementations may differ according
	to whether they treat these control keys specially (and
	ignore the terminfo), or use the terminfo definitions.
	Ncurses uses the terminfo definition.  If it says that
	KEY_ENTER is control/M, getch will return KEY_ENTER when
	you press control/M.

	Generally, KEY_ENTER denotes the character(s) sent by the
	Enter key on the numeric keypad:

	  - the terminal description lists the most useful keys,

	  - the Enter key on the regular keyboard is already handled
	    by the standard ASCII characters for carriage-return
	    and line-feed,

	  - depending on whether nl or nonl was called, pressing
	    "Enter" on the regular keyboard may return either
	    a carriage-return or line-feed, and finally

	  - "Enter or send" is the standard description for this
	    key.

-- 
vq




Messages sorted by: Reverse Date, Date, Thread, Author