Keyboard interaction

Bryson R. Payne, M.Ed.

Screen shot of Keyboard.c - filled sphere rotatingDiscussion:

This program builds on the previous tutorial by adding simple keyboard interaction, including both special key functions (arrows, page up/down) and regular key functions (W for wireframe toggle, Q for quit). Case statements allow us to quickly write code segments to respond to any input. We also add a data structure that keeps track of the rotation of the object on the three axes.

Sample code:

Click here to see the sample code: keyboard.c

Executable example:

Click here for a running demo: keyboard.exe


Back to Main Tutorial Page

Last modified December 11, 2000, Bryson R. Payne, bpayne@ngcsu.edu