// PROGRAM mouse #include "TrueBASIC.h" int main(); int main() { int s, ss = 3, w, h, Itmp1_; float x, y; GWopen(0); GWsize(1, &w, &h); do { // マウスの現在のウィンドウ座標 x,y と状態を返す if(GWmouse(&Itmp1_, &x, &y)) s = 1; else if(Itmp1_) s = 2; else s = 3; if(s == 1) { printf(" left button down %f %f\n", x/w, y/h); } else if(s == 2) { printf("right button down %f %f\n", x/w, y/h); } else if(s == 3) { if(ss != s) printf(" button released %f %f\n", x/w, y/h); } if((s == 1) && Itmp1_) break; ss = s; sleep(1); } while(1); GWquit(); return 0; }