GLUT cannot detect just the press of Ctrl. This fact is also hinted at by the fact that the "enumerator" for Ctrl is not GLUT_KEY_CTRL, but GLUT_ACTIVE_CTRL.
However, you can query the state of Ctrl
when another key is pressed:
case GLUT_KEY_RIGHT:
cout << "right key";
if (glutGetModifiers() & GLUT_ACTIVE_CTRL)
cout << " w/Ctrl";
cout << endl;
glutPostRedisplay(); // Redraw the scene
break;
See the documentation of glutGetModifiers()
for more details.