Skip to content

Viewer functions

PDLS-Viewer offers the corresponding functions to the keyboard commands.

Warning

Those functions are specific to the Viewer edition, and are not supported on the other editions.

For an optimal portability, use and check the WITH_VIEWER macro.

#if defined(WITH_VIEWER)

    myScreen.setViewerHelp(true);

#endif // WITH_VIEWER

General commands

Key Command Function
H or ? Help setViewerHelp()
S Save the screen on disk setViewerWrite()
Q Quit setViewerQuit()

Help

myScreen.setViewerHelp(true);

setViewerHelp() displays the help on the Viewer window. true displays it, false hides it.

This function corresponds to the H, Shift+H or ? keys.

Screen capture

myScreen.setViewerWrite(true);

setViewerWrite() saves the content of the Viewer window as a file. The name of the file starts with Capture_ and then mentions a chronological number.

This function corresponds to the S key.

Quit

myScreen.setViewerQuit();

setViewerQuit() quits the Viewer application.

This function corresponds to the Q key.

Display commands

Key Command Function
X and W Add and remove horizontal division setViewerGrid()
Y and T Add and remove a vertical division setViewerGrid()
Z and A Zoom-in and zoom-out setViewerZoom()
L Rotate left or clockwise setViewerRotation()
R Rotate right or counter-clockwise setViewerRotation()
O Select coordinates mode setViewerCoordinates()
I Inverse image setViewerInverse()
D or Space Back to default setViewerDefault()

Grid

myScreen.setViewerGrid(7, 5);

setViewerGrid() sets the horizontal and vertical grids with two parameters, the number of horizontal divisions and the number of vertical divisions. The value 0 removes the divisions.

This function corresponds to the X and W, Y and T keys.

Zoom

myScreen.setViewerZoom(2);

setViewerZoom() sets the zoom. Authorised values are 1, 2 and 3. Default value is 2.

This function corresponds to the Z and A keys.

Rotation

myScreen.setViewerAngle(90);

setViewerAngle() sets the orientation of the Viewer window, with four allowed values in degrees: 0, 90, 180 and 270.

This function corresponds to the L and R keys.

Coordinates

myScreen.setViewerCoordinates(1);

setViewerCoordinates() sets the coordinates mode with four modes:

  • 0 for no coordinates;

  • 1 for a pointer;

  • 2 for coordinates on a transparent circle; and

  • 3 for coordinates on a solid circle, simulating a finger.

Inverse

myScreen.setViewerInverse(true);

setViewerInverse() inverses the display of the Viewer window.

This function corresponds to the I key.

Default

myScreen.setViewerDefault();

setViewerDefault() restores the default parameters with

  • No horizontal and no vertical grid;

  • Zoom set at 2x;

  • No rotation;

  • No coordinates; and

  • No inverse.

This function corresponds to the D or Space keys.