2 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (c) 2000 - Rosimildo da Silva
8 // This module implements the "GsSelect()" function for MicroWindows.
10 // MODIFICATION/HISTORY:
13 // Revision 1.1.9.1 2009-06-15 14:11:07 lothar
14 // unified MX27, MX25, MX37 trees
16 // Revision 1.1.1.1 2001/06/21 06:32:41 greg
17 // Microwindows pre8 with patches
19 // Revision 1.1.1.1 2001/06/05 03:44:01 root
20 // First import of 5/5/2001 Microwindows to CVS
23 /////////////////////////////////////////////////////////////////////////////
28 #include <rtems/mw_uid.h>
32 extern MWBOOL MwCheckMouseEvent();
33 extern MWBOOL MwCheckKeyboardEvent();
39 extern struct MW_UID_MESSAGE m_kbd;
40 extern struct MW_UID_MESSAGE m_mou;
42 extern HWND dragwp; /* window user is dragging*/
44 * "Select() routine called by the Microwindows framework to receive events
45 * from the input devices.
49 struct MW_UID_MESSAGE m;
51 unsigned int timeout = 0;
53 /* perform pre-select duties, if any*/
56 scrdev.PreSelect(&scrdev);
58 /* Set up the timeout for the main select(). If
59 * the mouse is captured we're probably moving a window,
60 * so poll quickly to allow other windows to repaint while
61 * checking for more event input.
65 timeout = MwGetNextTimeoutValue(); /* returns ms*/
72 timeout = 10; /* 10ms required for vt fb switch*/
75 /* let's make sure that the type is invalid */
76 m.type = MV_UID_INVALID;
78 /* wait up to 100 milisecons for events */
79 rc = uid_read_message( &m, timeout );
81 /* return if timed-out or something went wrong */
84 if( errno != ETIMEDOUT )
85 EPRINTF( " rc= %d, errno=%d\n", rc, errno );
90 setfadelevel( &scrdev, fade );
99 /* let's pass the event up to microwindows */
102 /* Mouse or Touch Screen event */
106 while( MwCheckMouseEvent() )
113 MwCheckKeyboardEvent();
116 /* micro-windows does nothing with those.. */