Date: Wed, 12 May 1999 19:46:18 +1000 (EST) From: andrew@ugh.net.au To: Hellmuth Michaelis <hm@kts.org> Cc: freebsd-hackers@FreeBSD.ORG, snadge@gemcorp.com.au Subject: Re: Termcap and cursor keys Message-ID: <Pine.BSF.4.02A.9905121938470.2432-100000@magnesium.ideal.net.au> In-Reply-To: <m10fjmP-00002nC@bert.kts.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 7 May 1999, Hellmuth Michaelis wrote: > The cursor keys generate 2 different sequences depending on wether they > are in "normal" mode or "application mode": normal sends "CSI A" (where > CSI is 0x9b in 8-bit mode or "ESC [" in 7-bit mode) and application sends > "SS3 A" (where SS3 is 0x8f in 8-bit mode or "ESC O" in 7-bit mode). > > Mode switching is done by the sequence "CSI ? 1 h" (application) and > "CSI ? 1 l" (normal). > > Now what a given terminal sends depend on what it was switched to (or not) > in the init string(s) (look at "is=xxxx" in the termcap db entry). Well thanks for all your help. I have also found out that if the terminal in question needs to have its keypad switched to application mode the ks termcap capability is defined so: (void)tputs(ks, 1, putchar); will switch it on (assuming ks has already been filled out with tcgetstr). You can use: (void)tputs(ke, 1, putchar); to turn it off again before your program exits. Once the keypad is turned on the strings for the cursor keys given in the termcap database seem to work on all platforms (well the ones I've tried). I do notice there is no vi capability listed for cons25 though... Thanks again, Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02A.9905121938470.2432-100000>