2 /////////////////////////////////////////////////////////////////////////////
3 // $Header: /usr/cvs/microwin/src/drivers/mwselect_rtems.c,v 1.1.1.1 2001/06/21 06:32:41 greg Exp $
5 // Copyright (c) 2000 - Rosimildo da Silva
8 // This module implements the "GsSelect()" function for MicroWindows.
10 // MODIFICATION/HISTORY:
12 // $Log: mwselect_rtems.c,v $
13 // Revision 1.1.1.1 2001/06/21 06:32:41 greg
14 // Microwindows pre8 with patches
16 // Revision 1.1.1.1 2001/06/05 03:44:01 root
17 // First import of 5/5/2001 Microwindows to CVS
20 /////////////////////////////////////////////////////////////////////////////
25 #include <rtems/mw_uid.h>
29 extern MWBOOL MwCheckMouseEvent();
30 extern MWBOOL MwCheckKeyboardEvent();
36 extern struct MW_UID_MESSAGE m_kbd;
37 extern struct MW_UID_MESSAGE m_mou;
39 extern HWND dragwp; /* window user is dragging*/
41 * "Select() routine called by the Microwindows framework to receive events
42 * from the input devices.
46 struct MW_UID_MESSAGE m;
48 unsigned int timeout = 0;
50 /* perform pre-select duties, if any*/
53 scrdev.PreSelect(&scrdev);
55 /* Set up the timeout for the main select(). If
56 * the mouse is captured we're probably moving a window,
57 * so poll quickly to allow other windows to repaint while
58 * checking for more event input.
62 timeout = MwGetNextTimeoutValue(); /* returns ms*/
69 timeout = 10; /* 10ms required for vt fb switch*/
72 /* let's make sure that the type is invalid */
73 m.type = MV_UID_INVALID;
75 /* wait up to 100 milisecons for events */
76 rc = uid_read_message( &m, timeout );
78 /* return if timed-out or something went wrong */
81 if( errno != ETIMEDOUT )
82 EPRINTF( " rc= %d, errno=%d\n", rc, errno );
87 setfadelevel( &scrdev, fade );
96 /* let's pass the event up to microwindows */
99 /* Mouse or Touch Screen event */
103 while( MwCheckMouseEvent() )
110 MwCheckKeyboardEvent();
113 /* micro-windows does nothing with those.. */