
GPLOT recipes: The interactive cursor with keyboard commands
The cursor is most frequently used to inform the user what
the world coordinates are of a position that is pointed by
the mouse if you click a mouse button. It can also be used to set
markers by hand. But the world coordinates that are returned can also be
used to define a keyboard action where a position is wanted.
This way you can use GPLOT, and an output device like the X11 screen, as an
interactive drawing program.
Here is a simple example. First select the device:
COMMAND=device x11
Then, for example, define keyboard key 'd' as a draw command with
COMMAND=curtxt #D draw %.2f %.2f
curtxt is the command that stores the text. The text can be defined
either with #d or #D. draw is the command and %.2f is the C-type
number format used to display the world coordinates as returned by the
cursor (so that these can be edited).
Now start the interactive cursor:
COMMAND=cursor
- Press keyboard <d> to draw a line to the current cursor position.
- Press keyboard <D> (Capitals are used to edit the cursor text) to edit the draw command. (in Hermes command
line area you will see something like COMMAND=draw 23.34 18.21)
- Press keyboard <q> to quit the interactive cursor.