      program tektest
      dimension x(10), y(10)
      character *80 gna
      data x/1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0/
      data y/3.0, 4.0, 2.0, 6.0, 4.0, 6.0, 5.0, 8.0, 10.0, 9.5/

      call initt(12)
      call twindo(0,1000,0,770)
      call dwindo(0., 10., 0., 11.)
200   call pointa(x(1), y(1))
      do 100 i=1,10
100      call drawa(x(i), y(i))
      call scursr_bl(ichar, ix, iy)
      if (char(ichar).eq.'q' .or. char(ichar).eq.'Q') goto 300
c      print *, ichar, ix, iy
      call scursr(ichar, ix, iy)
      call erase()
      goto 200
300   continue
      call finitt(0, 700)
      end
c
C
C----------SUBROUTINE--SCURSR------------------------TEKTRONIX, INC.----
C
      SUBROUTINE SCURSR_bl(ICHAR,IX,IY)
      COMMON /TKTRNX/ TMINVX,TMINVY,TMAXVX,TMAXVY,TREALX,TREALY,
     & TIMAGX,TIMAGY,TRCOSF,TRSINF,TRSCAL,TRFACX,TRFACY,
     & TRPAR1,TRPAR2,TRPAR3,TRPAR4,TRPAR5,TRPAR6,KMOFLG(2),
     & KGNMOD,KPADV,KACHAR,KOBLEN,KTRAIL,KLEVEL,KPAD2,
     & KBAUDR,KGNFLG,KGRAFL,KHOMEY,KKMODE,KHORSZ,KVERSZ,KTBLSZ,
     & KSIZEF,KLMRGN,KRMRGN,KFACTR,KTERM,KLINE,KZAXIS,KBEAMX,KBEAMY,
     & KMOVEF,KPCHAR(5),KDASHT,KMINSX,KMINSY,KMAXSX,KMAXSY,KEYCON,
     & KINLFT,KOTLFT,KUNIT
      DIMENSION ICODE(2),IN(5)
      DATA ICODE(1),ICODE(2)/27,26/
C * SET THE GRAPHIC INPUT FLAG
      KGNMOD=1
C * OUTPUT (ESC) (SUB) TO TURN ON CURSOR
      IF(KTERM .GT. 0)CALL TOUTST(2,ICODE)
C * CURSER SHOULD ALWAYS INPUT A NEW BUFFER
      KINLFT=0
      CALL TINSTR(5,IN)
C * REMOVE THE GRAPHIC INPUT FLAG
      KGNMOD=0
C * RESTORE THE TERMINAL STATUS
      CALL RECOVR
      ICHAR=IN(1)
C * DECODE SCREEN CO-ORDINATES
      IX=MOD(IN(2),32)*32+MOD(IN(3),32)
      IY=MOD(IN(4),32)*32+MOD(IN(5),32)
9     format (1x,A,5(2x,i3))
      print 9,'Characters read (byte)    ',in(1),in(2),in(3),in(4),in(5)
      print *,'Character hit on keybord: ',char(ichar)
      print *,'Decoded/unscaled x,y    : ', ix, iy
C * APPLY SCREEN SCALE FACTOR
      IX=IX*4/KFACTR
      IY=IY*4/KFACTR
      print *,'Decoded/scaled x,y      : ', ix, iy
      RETURN
      END
c

