[net.micro.amiga] Synthesized features for the console device

dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) (06/25/86)

	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

andy@amiga.UUCP (Andy Finkel) (07/01/86)

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.