[net.micro.att] 7300 shift print escape sequence

juda@hounx.UUCP (#J.KAMINETSKY) (06/11/86)

The Equivalent Escape Sequence for Shift-Print is shown on page C-4
of the remote Access User's Manual as

ESC P R

It doesn't seem to work.

How do I emulate shift print?

jrw@hropus.UUCP (Jim Webb) (06/12/86)

> The Equivalent Escape Sequence for Shift-Print is shown on page C-4
> of the remote Access User's Manual as
> 
> ESC P R
> 
> It doesn't seem to work.
> 
> How do I emulate shift print?

If you are trying to dump the screen of a terminal connected to the
phone or rs232 port, I think you are out of luck, as UNIX has no idea
what's on it, at least at the kernel level.  As you probably know, the
console screen is memory mapped, so when you press the shift-print
key, it wakes up a system daemon that reads this section of memory
and formats it for an epson and sends this data to the lp spooler for
printing.  Now if it were Berkeley.... :-)
-- 
Jim Webb                                        ihnp4!houxm!hropus!jrw

bamford@ihuxy.UUCP (Bamford) (06/13/86)

> If you are trying to dump the screen of a terminal connected to the
> phone or rs232 port, I think you are out of luck, as UNIX has no idea
> what's on it, at least at the kernel level.  As you probably know, the
> console screen is memory mapped, so when you press the shift-print
> key, it wakes up a system daemon that reads this section of memory
> and formats it for an epson and sends this data to the lp spooler for
> printing.  Now if it were Berkeley.... :-)

There is an ioctl() call to get an array filled with the screen's image.
There is, however, no indication of the layout of that array so dumping
it to a printer is a lost cause.  If somebody can explain this layout,
then screen dumps can be done from a program...
-- 

				Harold Bamford
				AT&T Bell Labs
				(cornet) 8-367-5744
				Naperville, Ill
				(312) 979-5744

jrw@hropus.UUCP (Jim Webb) (06/14/86)

> There is an ioctl() call to get an array filled with the screen's image.
> There is, however, no indication of the layout of that array so dumping
> it to a printer is a lost cause.  If somebody can explain this layout,
> then screen dumps can be done from a program...


All of these ioctl's pertain to the BITMAP display, NOT
ASCII terminals attached via the RS-232 or PHONE lines!

Quoting window(7) of the PC UNIX 3.0 Admin's manual:

ioctl(wd,WIOCREAD,&pixmap)

	This ioctl causes the pixel image of the entire display
	to be "dumped" into memory at pixmap.  pixmap should be
	15,660 unsigned shorts arranged as 348 rows each containing
	45 unsigned shorts.  The least significant bit of the first
	short in the array contains the upper-left-hand display
	pixel.

So, on the PC, the screen is 348 x 720 pixels, which is exactly
what the pixmap is (348 x sizeof (short) * 45).  Therefore, all
one would have to do is in their program, define an array

		unsigned short pixmap[348][45];

do the above ioctl, and then dump each "row" to a file preceded 
by whatever escape sequences are required by your printer to
recognize bit maps.

Now, if you want to get really fancy, their is another neat ioctl:

ioctl(wd,WIOCSYS,num)

	This ioctl declares window wd to be system window num.
	There are currently three system windows.  Each system
	window "owns" a number of the keys on the keyboard, and
	regardless of which window is currently selected, if one
	of these keys is pressed, it is queued up for reading
	on the system window:

		num=0:  Window Manager
			Suspd, SHIFT-Suspd, Rsume, SHIFT-Rsume,
			*** SHIFT-Print ***

		num=1:	Phone Manager
			all SHIFT-ed function keys

		num=2:	Status Manager
			Msg, SHIFT-Msg

So, I would imagine that you could throw away the functionality of
the Status Manager for a while, and use the Msg keys to dump the
screen to a different printer (read, not an epson) or file.  I don't
think you would want to change the window manager, though, otherwise
it may (:-) be quite difficult to select another window.
-- 
Jim Webb                                        ihnp4!houxm!hropus!jrw