Home Documentation Download Screenshots Developper

QGLViewer keyboard shortcuts

The default QGLViewer keyboard behavior is fairly classical. The different shortcut keys can entirely be redefined by your application.

Default keyboard shortcuts

This table lists the QGLViewer functions that are associated with a default shortcut key.
Key Description Associated function Action
A Toggle the display of the world axis QGLViewer::toggleDrawAxis() DrawAxis
G Toggle the display of the XY grid QGLViewer::toggleDrawGrid() DrawGrid
F Toggle the display of the Frame per Second QGLViewer::toggleDisplayFPS() DisplayFPS
? Toggle the display of all the text QGLViewer::toggleDisplayText() EnableText
S Toggle the stereo display. QGLViewer::toggleStereo() Stereo
H Calls a help function. QGLViewer::help() Help
Esc Quit the application. qApp->quit() Exit
Space Switch between the FLY and REVOLVE camera mode. camera.toggleMode() CameraMode
Return Start/stop the animation loop. QGLViewer::toggleAnimationMode() Animation
Ctrl-S Open the save snapshot dialog box. QGLViewer::saveSnapshot() SaveScreenshot
Alt-Return Toggle the full screen mode QGLViewer::toggleFullScreen() FullScreen
Alt+(F1-F12) Defines a new camera key frame for path 1..12. camera.addKeyFrame(i) -
F1-F12 Plays/Pause camera key frame path (if defined). camera.playKeyFramePath(i) -
Ctrl+(F1-F12) Reset the camera key frame path 1..12. camera.resetKeyFramePath(i) -
C Toggle the camera key frame path editor. toggleCameraPathEditor() EditCameraPaths

Use QGLViewer::setShortcutKey(Action, Key) and QGLViewer::setShortcutStateKey(Action, StateKey) if you want to redefine one of these keys (for instance in your init() function). Action is defined by the ShortcutAction enum, as in the above table.

You can retrieve the current shortcut key value with shortcutKey(Action) and shortcutStateKey(Action).

The camera path shortcut keys can be redefined using the following methods: +/- changes the camera flySpeed. Arrows move the camera. May be defined as constant one day...

Key customization

You can define your own shortcut keys by overloading the void QGLViewer::keyPressEvent(QKeyEvent *e) function. See the documentation for details and code example.

Valid XHTML 1.0! Valid CSS! Last modified on jeudi, janvier 16 2003.