#include #include #include #include "ml.h" #include "kbd_keys.h" #include "ml_mouse.h" void main(void) { extern video_interface_t COL_PC_TEXT_INTERFACE,COL_PC_GRAPH_INTERFACE; init_video_par_t ivp={ EGA,EGAHI,egavga_driver,"" }; ml_retcode_t ch; unsigned k,u,count,x,y,event; char *s[]={ "Пусто","CH_MOUSE","CH_MOUSEBUTTON","CH_MOUSERELEASE","CH_MOUSEMOTION"}; clrscr(); /* set_start_interface(&COL_PC_GRAPH_INTERFACE,1,&ivp); */ set_start_interface(&COL_PC_TEXT_INTERFACE,1,NULL); do{ ch=wait(); k=ch-CH_MOUSE; if(k < 0 || k > 3) k=0; else k++; event=ask_mouse_event(&x,&y); printf("ch=0x%x(%c),event=%s,button=%d,X=%d,Y=%d.\n\n", ch,ch,s[k],event,x,y); } while(ch != _ESC); ms_hide(); clrscr(); close_video_interface(1,NULL); }