You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
775 B
34 lines
775 B
#define __LIBRARY__
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <all.h>
|
|
_syscall1(void,get_message,struct message *,msg);
|
|
_syscall2(int,timercreate,long,ms,int,type);
|
|
|
|
struct message msg;
|
|
|
|
int main()
|
|
{
|
|
timercreate(1000,TYPE_USER_TIMER_INFTY);
|
|
while(1)
|
|
{
|
|
get_message(&msg);
|
|
/* printf("msg.mid:%d\n", msg.mid); */
|
|
if (msg.mid > 0)
|
|
{
|
|
switch(msg.mid)
|
|
{
|
|
case MSG_USER_TIMER:
|
|
printf("MSG_USER_TIMER\n");
|
|
break;
|
|
case MSG_MOUSE_LEFT_DOWN:
|
|
printf("MSG_MOUSE_LEFT_DOWN\n");
|
|
break;
|
|
case MSG_MOUSE_RIGHT_DOWN:
|
|
printf("MSG_MOUSE_RIGHT_DOWN\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|