⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 event.c

📁 gumstiz u-boot loader in linux
💻 C
📖 第 1 页 / 共 2 页
字号:
    EVT_exit();    PM_fatalError("Unhandled exception!");}/****************************************************************************PARAMETERS:mouseMove   - Callback function to call wheneve the mouse needs to be movedREMARKS:Initiliase the event handling module. Here we install our mouse handling ISRto be called whenever any button's are pressed or released. We also buildthe free list of events in the event queue.We use handler number 2 of the mouse libraries interrupt handlers for ourevent handling routines.****************************************************************************/void EVTAPI EVT_init(    _EVT_mouseMoveHandler mouseMove){    /* Initialise the event queue */    EVT.mouseMove = mouseMove;    initEventQueue();    memset(keyUpMsg,0,sizeof(keyUpMsg));    /* Catch program termination signals so we can clean up properly */    signal(SIGABRT, _EVT_abort);    signal(SIGFPE, _EVT_abort);    signal(SIGINT, _EVT_abort);}/****************************************************************************REMARKSChanges the range of coordinates returned by the mouse functions to thespecified range of values. This is used when changing between graphicsmodes set the range of mouse coordinates for the new display mode.****************************************************************************/void EVTAPI EVT_setMouseRange(    int xRes,    int yRes){    rangeX = xRes;    rangeY = yRes;}/****************************************************************************REMARKSModifes the mouse coordinates as necessary if scaling to OS coordinates,and sets the OS mouse cursor position.****************************************************************************/void _EVT_setMousePos(    int *x,    int *y){    /* Scale coordinates up to desktop coordinates first */    int scaledX = (*x * _PM_deskX) / rangeX;    int scaledY = (*y * _PM_deskY) / rangeY;    /* Scale coordinates back to screen coordinates again */    *x = (scaledX * rangeX) / _PM_deskX;    *y = (scaledY * rangeY) / _PM_deskY;    SetCursorPos(scaledX,scaledY);}/****************************************************************************REMARKS:Initiailises the internal event handling modules. The EVT_suspend functioncan be called to suspend event handling (such as when shelling out to DOS),and this function can be used to resume it again later.****************************************************************************/void EVT_resume(void){    /* Do nothing for Win32 */}/****************************************************************************REMARKSSuspends all of our event handling operations. This is also used tode-install the event handling code.****************************************************************************/void EVT_suspend(void){    /* Do nothing for Win32 */}/****************************************************************************REMARKSExits the event module for program terminatation.****************************************************************************/void EVT_exit(void){    /* Restore signal handlers */    signal(SIGABRT, SIG_DFL);    signal(SIGFPE, SIG_DFL);    signal(SIGINT, SIG_DFL);}/****************************************************************************DESCRIPTION:Returns the mask indicating what joystick axes are attached.HEADER:event.hREMARKS:This function is used to detect the attached joysticks, and determinewhat axes are present and functioning. This function will re-detect anyattached joysticks when it is called, so if the user forgot to attachthe joystick when the application started, you can call this function tore-detect any newly attached joysticks.SEE ALSO:EVT_joySetLowerRight, EVT_joySetCenter, EVT_joyIsPresent****************************************************************************/int EVTAPI EVT_joyIsPresent(void){    /* TODO: Implement joystick code based on DirectX! */    return 0;}/****************************************************************************DESCRIPTION:Polls the joystick for position and button information.HEADER:event.hREMARKS:This routine is used to poll analogue joysticks for button and positioninformation. It should be called once for each main loop of the userapplication, just before processing all pending events via EVT_getNext.All information polled from the joystick will be posted to the eventqueue for later retrieval.Note:   Most analogue joysticks will provide readings that change even	though the joystick has not moved. Hence if you call this routine	you will likely get an EVT_JOYMOVE event every time through your	event loop.SEE ALSO:EVT_getNext, EVT_peekNext, EVT_joySetUpperLeft, EVT_joySetLowerRight,EVT_joySetCenter, EVT_joyIsPresent****************************************************************************/void EVTAPI EVT_pollJoystick(void){}/****************************************************************************DESCRIPTION:Calibrates the joystick upper left positionHEADER:event.hREMARKS:This function can be used to zero in on better joystick calibration factors,which may work better than the default simplistic calibration (which assumesthe joystick is centered when the event library is initialised).To use this function, ask the user to hold the stick in the upper leftposition and then have them press a key or button. and then call thisfunction. This function will then read the joystick and update thecalibration factors.Usually, assuming that the stick was centered when the event library wasinitialized, you really only need to call EVT_joySetLowerRight since theupper left position is usually always 0,0 on most joysticks. However, thesafest procedure is to call all three calibration functions.SEE ALSO:EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joyIsPresent****************************************************************************/void EVTAPI EVT_joySetUpperLeft(void){}/****************************************************************************DESCRIPTION:Calibrates the joystick lower right positionHEADER:event.hREMARKS:This function can be used to zero in on better joystick calibration factors,which may work better than the default simplistic calibration (which assumesthe joystick is centered when the event library is initialised).To use this function, ask the user to hold the stick in the lower rightposition and then have them press a key or button. and then call thisfunction. This function will then read the joystick and update thecalibration factors.Usually, assuming that the stick was centered when the event library wasinitialized, you really only need to call EVT_joySetLowerRight since theupper left position is usually always 0,0 on most joysticks. However, thesafest procedure is to call all three calibration functions.SEE ALSO:EVT_joySetUpperLeft, EVT_joySetCenter, EVT_joyIsPresent****************************************************************************/void EVTAPI EVT_joySetLowerRight(void){}/****************************************************************************DESCRIPTION:Calibrates the joystick center positionHEADER:event.hREMARKS:This function can be used to zero in on better joystick calibration factors,which may work better than the default simplistic calibration (which assumesthe joystick is centered when the event library is initialised).To use this function, ask the user to hold the stick in the centerposition and then have them press a key or button. and then call thisfunction. This function will then read the joystick and update thecalibration factors.Usually, assuming that the stick was centered when the event library wasinitialized, you really only need to call EVT_joySetLowerRight since theupper left position is usually always 0,0 on most joysticks. However, thesafest procedure is to call all three calibration functions.SEE ALSO:EVT_joySetUpperLeft, EVT_joySetLowerRight, EVT_joySetCenter****************************************************************************/void EVTAPI EVT_joySetCenter(void){}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -