Path: utzoo!attcan!uunet!mcvax!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.sources.bugs Subject: jove 4.9 (support for TVI FUNCT key) Message-ID: <46@titania.warwick.ac.uk> Date: 10 Sep 88 12:12:40 GMT Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 64 Televideo terminals and some others (e.g. the Newbury's round here) have a FUNCT key which sends `^Ax\r' if held down while pressing `x'. This little function allows you to use this as a meta-key if you bind tvi-function-key to C-a. (Of course you'll want to bind beginning-of-line somewhere else, like ESC C-a.) RCS file: misc.c,v retrieving revision 1.1 diff -c -r1.1 misc.c *** /tmp/,RCSt1a02142 Sat Sep 10 13:06:44 1988 --- misc.c Sat Sep 10 11:19:49 1988 *************** *** 312,317 **** --- 312,331 ---- SetLine(newline); } + void + TVIFunc() + { + int cmd, c; + + cmd = getch(); + if ((c = getch()) != '\r') { + Ungetc(c); /* Oops, wasn't ^A x \r after all. */ + complain("[Bad function sequence]"); + } + Ungetc(cmd); + HandlePref(pref1map); /* like ESC x */ + } + #ifdef ANSICODES void MoveToCursor(line, col) RCS file: funcdefs.c,v retrieving revision 1.1 diff -c -r1.1 funcdefs.c *** /tmp/,RCSt1a02148 Sat Sep 10 13:07:27 1988 --- funcdefs.c Sat Sep 10 11:18:06 1988 *************** *** 203,208 **** --- 203,209 ---- StrLength(), TransChar(), TransLines(), + TVIFunc(), SaveFile(), WtModBuf(), WriteFile(), *************** *** 565,570 **** --- 566,572 ---- DefMajor(TEXT), "text-mode", WIRED_CMD(0), FUNCTION, "transpose-characters", WIRED_CMD(TransChar), FUNCTION, "transpose-lines", WIRED_CMD(TransLines), + FUNCTION, "tvi-function-key", WIRED_CMD(TVIFunc), FUNCTION, "unbind-key", WIRED_CMD(UnbindC), FUNCTION, "version", WIRED_CMD(ShowVersion), FUNCTION, "visible-spaces-in-window", WIRED_CMD(WVisSpace), -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England