@node Cursor, Data, Ctype, Commands @iftex @syntax Cursor. @end iftex @example Syntax: CURSOR CURSOR WORD1 WORD2 @end example @pindex Cursor Display the cross-hair cursor to enable you to get positions (in user coordinates). The current cursor position is typed on the screen every time that you hit a key; some keys are special, specifically you can exit the cursor routine by hitting `e' or `q'. If you exit with `e', CURSOR issues a relocate command to set the current plot position to the cursor position, and puts the command in the history buffer. If you exit with `q', no entry is made in the buffer. Usually successive positions overwrite each other, but if a digit is used to mark a point then the position is followed by a newline, so the next time you hit a key its position will appear on the next line. (You can remember that digits lead to numerous values appearing). Many graphics devices have things called ``GIN terminators''. SM usually expects that this be set to `Carriage Return' with no extra characters, EOT is a popular (unacceptable) choice. If you have trouble check your graphics setup screen, then with your SM Guru who can look up in graphcap to see what is expected. If the local Guru were very friendly, he could change your GIN terminator to anything he wanted, even EOT, but he probably isn't. @findex GIN terminators The other form enables you to define a pair of vectors @code{WORD1} and @code{WORD2}. SM provides you with a cursor, and every time that you hit a key it prints its position (just as above). If the letter is `e' or `p' it draws a point of the current type at the current position, prints the current position, and enters the (x,y) coordinates in the vectors; if you use `m' to mark a point the coordinates are not written to the screen, but the point is still added to the vectors. Exit with `q', or abort with a @ctrl{C} in which case @code{WORD1} and @code{WORD2} are unchanged. Note that if you want to use SPLINE on the vectors produced in this way, you should take care that at least one of the vectors is monotonic and increasing, or use the SORT command. See also IMAGE CURSOR which returns the value under the cursor as well as the position if an IMAGE (@pxref{Image}) has been defined. For devices with mice, if the buttons do anything, they should generate the characters `e', `p', and `q' (starting at the left). There is nothing special about `p', except that it is @emph{not} `e' or `q' so it simply prints the current position. The SunWindows cursor is slightly different. The cursor position is given by a pointing finger (it's the best we could do), and SM won't see any characters typed at the keyboard until you hit a carriage return. Device @code{sunwindows} is obsolete anyway, you should simply switch to using the @code{sunview} driver. @emph{Its} cursor has a bug, in that it only sees every other character typed at the keyboard. If I knew why I'd fix it. @findex sun cursor