Path: utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.os.vms Subject: Re: TPU: Key-name question Message-ID: <2576@enea.se> Date: 2 Jan 88 16:39:24 GMT References: <2571@enea.se> Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.os.vms Organization: ENEA DATA AB, Sweden Lines: 24 A while ago I asked whether someone knew a more efficient to deduce what printable character, if any, the key name returned by Read_key referred to than to loop. There is. ASCII(Key) returns the character if it's printable. For a non-printable character, it returns the null character. Does this stand in the manual? Well, yes and no. For the ASCII you find that it does only use the lowest byte of the integer it gets. But the key-name coding is not there. (At least I haven't found it.) But in an article from The Leverage, feb 1987, Jeff Kennedy describes the coding. The last byte of the code is the ASCII value for a printable character. The most interesting with these codes is that you can very well use key combinations like -7 for commands. But, be careful: TPU cannot distinguish between -A, -[A and -OA. It says, "escape, ah a keypad function!" And then it just cares about the closing character of the sequence and ignores those in between. -- Erland Sommarskog ENEA Data, Stockholm sommar@enea.UUCP C, it's a 3rd class language, you can tell by the name.