home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex105.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
874b
|
22 lines
// Example: 105 from Library Reference
#include "..\3D-Ware\dddware.h"
#include <stdio.h>
short main(void)
{
dddInitKeybd(); // Initialise the 3D-Ware key reading facilities.
while (!dddkeycode) // Loop until a key is pressed.
{
dddReadJoystick(); // Read the joystick port.
// Print the X value.
printf("Joystick Xpos is %d\t",joystick_x_position);
// Print the Y value.
printf("Joystick Ypos is %d\t",joystick_y_position);
// Print the left button state.
printf("Joystick button 1 is %d\t",joystick_left_button);
// Print the right button state.
printf("Joystick button 2 is %d\n",joystick_right_button);
}
dddRestoreKeybd(); // Release the keyboard back to dos.
return 0; // Bye.
}