Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!ut-sally!pyramid!amiga!andy From: andy@amiga.UUCP (Andy Finkel) Newsgroups: net.micro.amiga Subject: Re: Synthesized features for the console device Message-ID: <1367@amiga.amiga.UUCP> Date: Mon, 30-Jun-86 19:38:31 EDT Article-I.D.: amiga.1367 Posted: Mon Jun 30 19:38:31 1986 Date-Received: Wed, 2-Jul-86 03:48:48 EDT References: <8606251901.AA00376@pavepaws> Reply-To: andy@skipper.UUCP (andy finkel) Organization: Commodore Business Machines, 1200 Wilson Drive, West Chester, PA 19380 Lines: 45 In article <8606251901.AA00376@pavepaws> dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) writes: > > Is it kosher to use the Unit number for the console device (actually >a structure pointer) to get the current X and Y cursor position? Currently, >it's the only way I have to get that information. It would be too difficult >for me to intercept it from the read stream. > > -Matt What ? You don't want to decode escape sequences ? hmmmm... Sure. You can read it from the ConUnit, no problem. If you're playing fancy games (even if you're not) you you should wait for the cursor position to settle down. Here's a code fragment... (this assumes you've got the console.device opened via OpenDevice, *NOT* as a DOS CON:, ok ?) (and be sure you #include conunit.h) write your last string if (CheckIO(&consoleIO)==0) WaitIO(&consoleIO); /* wait for write to end */ row = ((struct ConUnit *)consoleIO.io_Unit)->cu_YCCP; column = ((struct ConUnit *)consoleIO.io_Unit)->cu_XCCP; Remember, this is the cursor position. If you want the current character position , use: row = ((struct ConUnit *)consoleIO.io_Unit)->cu_YCP; column = ((struct ConUnit *)consoleIO.io_Unit)->cu_XCP; andy -- andy finkel Commodore(Amiga) {ihnp4|seismo|allegra}!cbmvax!andy or pyramid!amiga!andy Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors. "Remember, no matter where you grow, there you are." - Buckaroo Bonsai.