示例#1
0
/****************************************************************************
REMARKS:
Initialise the mouse driver
****************************************************************************/
void InitMouse(
    int xRes,
    int yRes)
{
    EVT_setMouseRange(xRes-1,yRes-1);
    EVT_setMousePos(xRes/2,yRes/2);
}
示例#2
0
/****************************************************************************
REMARKS:
Main program entry point
****************************************************************************/
int main(void)
{
    event_t     evt;
    ibool       done = false;
    PM_HWND     hwndConsole;

    hwndConsole = PM_openConsole(0,0,0,0,0,true);
    EVT_init(&moveMouse);
    EVT_setMouseRange(1024,768);
    CalibrateJoy();
    do {
	EVT_pollJoystick();
	if (EVT_getNext(&evt,EVT_EVERYEVT)) {
	    switch (evt.what) {
		case EVT_KEYDOWN:
		    DisplayKey("EVT_KEYDOWN  ", &evt);
		    if (EVT_scanCode(evt.message) == KB_esc)
			done = true;
		    break;
		case EVT_KEYREPEAT:
		    DisplayKey("EVT_KEYREPEAT", &evt);
		    break;
		case EVT_KEYUP:
		    DisplayKey("EVT_KEYUP    ", &evt);
		    break;
		case EVT_MOUSEDOWN:
		    DisplayMouse("EVT_MOUSEDOWN", &evt);
		    break;
		case EVT_MOUSEAUTO:
		    DisplayMouse("EVT_MOUSEAUTO", &evt);
		    break;
		case EVT_MOUSEUP:
		    DisplayMouse("EVT_MOUSEUP  ", &evt);
		    break;
		case EVT_MOUSEMOVE:
		    DisplayMouse("EVT_MOUSEMOVE", &evt);
		    break;
		case EVT_JOYCLICK:
		    DisplayJoy("EVT_JOYCLICK ", &evt);
		    break;
		case EVT_JOYMOVE:
		    DisplayJoy("EVT_JOYMOVE  ", &evt);
		    break;
		}
	    }
	} while (!done);
    EVT_exit();
    PM_closeConsole(hwndConsole);
    return 0;
}
示例#3
0
/****************************************************************************
REMARKS:
Initialise the mouse driver
****************************************************************************/
void InitMouse(
    int xRes,
    int yRes)
{
    EVT_setMouseRange(xRes-1,yRes-1);
}