Skip to content

Viewer functions

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


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)


#endif // WITH_VIEWER

General commands

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



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


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.



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()


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.



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

This function corresponds to the Z and A keys.



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.



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.



setViewerInverse() inverses the display of the Viewer window.

This function corresponds to the I key.



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.