Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!lll-lcc!well!nortond From: nortond@well.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: control-P = PrtSc on PC/AT's Message-ID: <2807@well.UUCP> Date: Sat, 21-Mar-87 14:22:58 EST Article-I.D.: well.2807 Posted: Sat Mar 21 14:22:58 1987 Date-Received: Sun, 22-Mar-87 20:41:24 EST References: <243@fornax.uucp> <10121@cgl.ucsf.EDU> <245@fornax.uucp> Organization: Home Lines: 200 Summary: Raw Mode Doesn't Work for Me I had commented earlier on this subject that I had heard that the only sucessful solution to this problem was by filtering keystrokes at the scan code interrupt level, and recent experiences with the code suggested indicate that my initial comments were correct. I have been corrected, however, that the CTRL-P function is not performed in the BIOS. The recently posted "setraw" and "setcookd" programs did not solve the CTRL-P problem completely. These examples only set raw mode for standard output and this allowed the CTRL-C to pass through. When I modified it to also set standard input to raw mode, the CTRL-C had no effect during output. Unfortunately, the CTRL-C was not passed through on calls to read the keyboard. If you set both stdin and stdout to raw mode, the CTRL-P does not cause printer-echo to toggle, but the keystroke is not passed through either. Somehow, the CTRL-P does cause some internal flag to be toggled, for when I toggle it and press CTRL-C (while waiting for input), the "^C" characters appear on my printer. I am running MS-DOS (not PC-DOS) 3.2 on a Toshiba XT computer with 640k of memory. What follows is a shell archive of the modified "setraw" and "setcookd" programs: ------------------------------ CUT HERE ------------------------------ #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # setcookd.asm # setraw.asm # setcookd.uue # setraw.uue # # This archive created: Sat Mar 21 13:36:50 1987 # if test -f 'setcookd.asm' then echo shar: will not over-write existing "'setcookd.asm'" else echo extracting "'setcookd.asm'" sed 's/^X//' >setcookd.asm <<'SHAR_EOF' X;----- dos ---------------------- X; Call DOS function # n. Xdos macro fn X mov ah, fn X int 21h X endm X Xcode segment para public 'CODE' X assume cs:code X X org 100h X X;----- Setcookd ------------------------------------------- X; Sets cooked state of stdout if it is a device. X; Returns errorcode in AX if DOS error. Xsetcookd proc near X DOS 30h X cmp al,2 X jb dos1_exit X mov bx,0 X mov al, 0 X DOS 44h X jc sc_stdo X test dl, 80h ; It it a device? X jz sc_stdo ; nope- do nothing. X ; Current mode in DX X and dx, 00cfh ; clear old raw bit and hi byte, X mov al, 1 X DOS 44h Xsc_stdo: X mov bx,1 X mov al, 0 X DOS 44h X jc sc_exit X test dl, 80h ; It it a device? X jz sc_exit ; nope- do nothing. X ; Current mode in DX X and dx, 00cfh ; clear old raw bit and hi byte, X mov al, 1 X DOS 44h Xsc_exit: X DOS 4Ch Xdos1_exit: X int 20h Xsetcookd endp X Xcode ends X end setcookd SHAR_EOF if test 1229 -ne "`wc -c < 'setcookd.asm'`" then echo shar: error transmitting "'setcookd.asm'" '(should have been 1229 characters)' fi chmod 666 setcookd.asm fi if test -f 'setraw.asm' then echo shar: will not over-write existing "'setraw.asm'" else echo extracting "'setraw.asm'" sed 's/^X//' >setraw.asm <<'SHAR_EOF' X;----- dos ---------------------- X; Call DOS function # n. Xdos macro fn X mov ah, fn X int 21h X endm X Xcode segment para public 'CODE' X assume cs:code X X org 100h X X;----- Setraw ------------------------------------------- X; Sets Raw state of stdout if it is a device. X; Returns errorcode in AX if DOS error. Xsetraw proc near X DOS 30h X cmp al,2 X jb dos1_exit X mov bx,0 X mov al, 0 X DOS 44h X jc sr_stdo X test dl, 80h ; It it a device? X jz sr_stdo ; nope- do nothing. X ; Current mode in DX X and dx, 00cfh ; clear old raw bit and hi byte, X or dx, 20h ; set RAW bit X mov al, 1 X DOS 44h Xsr_stdo: X mov bx,1 X mov al, 0 X DOS 44h X jc sr_exit X test dl, 80h ; It it a device? X jz sr_exit ; nope- do nothing. X ; Current mode in DX X and dx, 00cfh ; clear old raw bit and hi byte, X or dx, 20h ; set RAW bit X mov al, 1 X DOS 44h Xsr_exit: X DOS 4Ch Xdos1_exit: X int 20h Xsetraw endp X Xcode ends X end setraw SHAR_EOF if test 1310 -ne "`wc -c < 'setraw.asm'`" then echo shar: error transmitting "'setraw.asm'" '(should have been 1310 characters)' fi chmod 666 setraw.asm fi if test -f 'setcookd.uue' then echo shar: will not over-write existing "'setcookd.uue'" else echo extracting "'setcookd.uue'" sed 's/^X//' >setcookd.uue <<'SHAR_EOF' Xbegin 666 setcookd.com XMM##-(3P"+/ + !M$3-(;L! + M$3-(7(/ X5]L* = J!XL\ L &T1,TAM$S-(setraw.uue <<'SHAR_EOF' Xbegin 666 setraw.com XMM##-(3P"+/ ('*( "P ;1$S2&[ 0"P +1$ X=S2%R$_;"@'0.@>+/ ('*( "P ;1$S2&T3,TAS2#* X Xend SHAR_EOF if test 131 -ne "`wc -c < 'setraw.uue'`" then echo shar: error transmitting "'setraw.uue'" '(should have been 131 characters)' fi chmod 666 setraw.uue fi # end of shell archive exit 0 -- Daniel A. Norton ...!lll-lcc!{lll-crg,ptsfa}!well!nortond