#include #include #include struct Library *LucyPlayBase = NULL; int main(VOID) { LucyPlayJoystick *joy; if (LucyPlayBase = (struct Library *)OpenLibrary("lucyplay.library", 1)) { if (joy = lucJoyInit()) { while (!joy->Red) { lucJoyRead(joy); if (joy->Up) printf("up\n"); if (joy->Down) printf("down\n"); if (joy->Left) printf("left\n"); if (joy->Right) printf("right\n"); /* ** This is no good example, because the joyport ** is read in a too tight loop. This could cause ** system lockups. Be sure to do something more ** than just waiting for joystick action. If there ** is nothing else to do, use dos/Delay() or so. */ } lucJoyKill(joy); } CloseLibrary(LucyPlayBase); } return(0); }