Path: utzoo!utgpu!watmath!att!bellcore!rutgers!gatech!bloom-beacon!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.terminals Subject: Re: Can ANSI/DEC terminals report keypad mode? Message-ID: <3661@buengc.BU.EDU> Date: 8 Aug 89 17:40:38 GMT References: <1217@syma.sussex.ac.uk> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.terminals Organization: Boston Univ. Col. of Eng. Lines: 51 In article <1217@syma.sussex.ac.uk> leilabd@syma.sussex.ac.uk (Leila Burrell-Davis) writes: >On leaving a program, I'd like to put the keyboard back into the same >state it was in at the start, in particular the numeric keypad into >either applications or numeric mode. Can anyone tell me if ANSI/DEC >terminals will report this information and, if not, suggest how I >might do this? I don't see it explicitly. Here's an experiment, though: According to my vt340 programmers' manual, which may be applicable only to vt300's for this feature, (but who can tell with DEC's "go fish" documentation-organizational style) you might try a Terminal Status Report (called DECTSR, I don't know if the ANSI name for it exists): CSI 1 $ u (CSI is ^[[, most places; spaces are for readability only and should not be inserted, but you know that, right?) Which will send back 196 bytes of data on the terminal status (essentially everything determinate about it) which are of the form 0100xxxx in binary; i.e., the 4 MSB's are always 0100, and the 4 LSB's indicate the value. The data come back as DCS 1 $ s d ..d ST 1 196 (DCS and ST are control sequences, as is CSI.) What the checksums look like, I have no idea. "Look for the ST" is my advice. I see no information on decoding the TSR. You just put it back when you want the terminal back the way it was (shades of setjmp() :-) ) with a DECRSTS: DCS 1 $ d ...d ST 1 196 Notice that the checksums are gone. Oboy is this gonna be fun to program... There is a note warning that the format of the report is not compatible for all vt300's, so you couldn't, say, snarf the setup on yours and send it to your friend Freddy and expect it to auto-configure his. --Blair "I just wanna turn off my vt220 without losing the user-defined- keys... :-("