        SUBROUTINE CURSOR(X,Y,KEY)
        IMPLICIT NONE
        REAL*4 X,Y
        INTEGER IERR
        INTEGER*1 KEY
C
C       DISPLAY AND READ THE GRAPHICS CURSOR AND RETURN ITS POSITION
C       IN USER COORDINATES.
C
        INCLUDE DIGLIB$KOM:PLTCOM.PRM
        INCLUDE DIGLIB$KOM:PLTSIZ.PRM
C
C       GET CURSOR POSITION IN VIRTUAL COORDINATES.
C
        CALL GSGIN(X,Y,KEY,IERR)
        IF (IERR .GE. 0) GO TO 50
        X = XVSTRT
        Y = YVSTRT
50      X = (X-XVSTRT)*UDX/XVLEN + UX0
        IF (LOGX) X = 10.0**X
        Y = (Y-YVSTRT)*UDY/YVLEN + UY0
        IF (LOGY) Y = 10.0**Y
        RETURN
        END
