/uspace/trunk/console/console.c |
---|
298,6 → 298,9 |
case IPC_M_PHONE_HUNGUP: |
/* TODO: Handle hangup */ |
return; |
case KBD_MS_MOVE: |
gcons_mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
break; |
case KBD_PUSHCHAR: |
/* got key from keyboard driver */ |
/uspace/trunk/console/gcons.c |
---|
230,6 → 230,28 |
vp_switch(0); |
} |
static inline int limit(int a,int left, int right) |
{ |
if (a < left) |
a = left; |
if (a >= right) |
a = right - 1; |
return a; |
} |
void gcons_mouse_move(int dx, int dy) |
{ |
static int x = 0; |
static int y = 0; |
x = limit(x+dx, 0, xres); |
y = limit(y+dy, 0, yres); |
async_msg_2(fbphone, FB_POINTER_MOVE, x, y); |
} |
/** Draw a PPM pixmap to framebuffer |
* |
* @param logo Pointer to PPM data |
/uspace/trunk/console/gcons.h |
---|
41,6 → 41,7 |
void gcons_in_kernel(void); |
void gcons_notify_connect(int consnum); |
void gcons_notify_disconnect(int consnum); |
void gcons_mouse_move(int dx, int dy); |
#endif |