We have also registered a function to handle special key presses. The special keys include the arrow keys, function keys and others. The keys are identified by integers that are defined by GLUT. For example, GLUT_KEY_UP and GLUT_KEY_DOWN identify respectively the up arrow key and the down arrow key.

Similar to our keyboard handler, the special keyboard handler selects an appropriate action based on the key pressed and passed to our handler. For our example, the action is to change the scale factor (up or down) for the selected geometric object.