Add ege3.cpp

This commit is contained in:
daleclack 2020-09-15 20:53:34 +08:00 committed by GitHub
parent ba901b36bb
commit 039f8c1161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

20
ege/ege3.cpp Normal file
View File

@ -0,0 +1,20 @@
#include<cstdio>
#include<graphics.h>
using namespace std;
int main(){
initgraph(480,360);
setfont(18,0,"SimSum");
mouse_msg msg={0};
for(;is_run();delay_fps(60)){
while(mousemsg()){
msg=getmouse();
}
cleardevice();
xyprintf(0,0,"x=%10d y=%10d",msg.x,msg.y);
xyprintf(0,20,"move=%d down=%d up=%d",(int)msg.is_move(),(int)msg.is_down(),(int)msg.is_up());
xyprintf(0,40,"left=%d right=%d mid=%d",(int)msg.is_left(),(int)msg.is_right(),(int)msg.is_mid());
xyprintf(0,60,"wheel=%d wheel rotare=%d",(int)msg.is_wheel(),msg.wheel);
}
closegraph();
return 0;
}