static void handleScanCode( int key) { switch (key) { /* start of view position functions */ case KB_right: TurnRight(); break; case KB_left: TurnLeft(); break; case KB_down: TurnForwards(); break; case KB_up: TurnBackwards(); break; /* end of view postions functions */ /* start of miseclleneous functions */ case KB_pageUp: FireCannon(); break; case KB_home: Toggle(); break; /* end of miscelleneous functions */ } }
/* ARGSUSED1 */ void special(int key, int x, int y) { int i = 0; switch (key) { /* start of view position functions */ case GLUT_KEY_RIGHT:{ TurnRight(); i++; } break; case GLUT_KEY_LEFT:{ TurnLeft(); i++; } break; case GLUT_KEY_DOWN:{ TurnForwards(); i++; } break; case GLUT_KEY_UP:{ TurnBackwards(); i++; } break; /* end of view postions functions */ /* start of miseclleneous functions */ case GLUT_KEY_PAGE_UP:{ FireCannon(); i++; } break; /* end of miscelleneous functions */ } if (i) glutPostRedisplay(); }
GLenum key(int key, GLenum mask) { int i = 0; switch (key) { /* start arm control functions */ case 'q': { shoulder2Subtract(); i++; } break; case 'a': { shoulder2Add(); i++; } break; case 'w': { shoulder1Subtract(); i++; } break; case 's': { shoulder1Add(); i++; } break; case '2': { shoulder3Add(); i++; } break; case '1': { shoulder4Add(); i++; } break; case '4': { shoulder3Subtract(); i++; } break; case '3': { shoulder4Subtract(); i++; } break; case 'z': { lat2Raise(); i++; } break; case 'Z': { lat2Lower(); i++; } break; case 'x': { lat1Raise(); i++; } break; case 'X': { lat1Lower(); i++; } break; case 'A': { elbow2Add(); i++; } break; case 'Q': { elbow2Subtract(); i++; } break; case 'S': { elbow1Add(); i++; } break; case 'W': { elbow1Subtract(); i++; } break; /* end of arm control functions */ /* start of torso control functions */ case 'd': { RotateAdd(); i++; } break; case 'g': { RotateSubtract(); i++; } break; case 'r': { MechTiltAdd(); i++; } break; case 'f': { MechTiltSubtract(); i++; } break; /* end of torso control functions */ /* start of leg control functions */ case 'h': { RaiseLeg2Forward(); i++; } break; case 'y': { LowerLeg2Backwards(); i++; } break; case 'Y': { RaiseLeg2Outwards(); i++; } break; case 'H': { LowerLeg2Inwards(); i++; } break; case 'j': { RaiseLeg1Forward(); i++; } break; case 'u': { LowerLeg1Backwards(); i++; } break; case 'U': { RaiseLeg1Outwards(); i++; } break; case 'J': { LowerLeg1Inwards(); i++; } break; case 'N': { Heel2Add(); i++; } break; case 'n': { Heel2Subtract(); i++; } break; case 'M': { Heel1Add(); i++; } break; case 'm': { Heel1Subtract(); i++; } break; case 'k': { Ankle2Add(); i++; } break; case 'K': { Ankle2Subtract(); i++; } break; case 'l': { Ankle1Add(); i++; } break; case 'L': { Ankle1Subtract(); i++; } break; /* end of leg control functions */ /* start of light source position functions */ case 'p': { LightTurnRight(); i++; } break; case 'i': { LightTurnLeft(); i++; } break; case 'o': { LightForwards(); i++; } break; case '9': { LightBackwards(); i++; } break; /* end of light source position functions */ /* start of misc functions */ case 't': Toggle(); break; case KEY_LEFT: TurnLeft(); break; case KEY_RIGHT: TurnRight(); break; case KEY_UP: TurnBackwards(); break; case KEY_DOWN: TurnForwards(); break; case ' ': FireCannon(); } return 0; }