怎么才能支持按键按下去后不放,连续播放图片?
我做了一个实现简单的动画功能,但是只支持按下后放开,按这不放的时候要停顿5秒左右才能连续播放动画;怎么实现按下后不要停顿能连续播放?
/*回调函数*/static void draw_boy(timer * pMe){IDISPLAY_ClearScreen(pMe->a.m_pIDisplay); switch(pMe->wParam) { case AVK_UP: IIMAGE_SetParm(pMe->LPBoy_up_down,IPARM_OFFSET,0,(pMe->pi.cy/14)*(13 - (pMe->boy_infor.boy_up) )); IIMAGE_SetDrawSize(pMe->LPBoy_up_down,22,pMe->pi.cy/14); IIMAGE_Draw(pMe->LPBoy_up_down,pMe->boy_infor.x,pMe->boy_infor.y); //IBASE_Release((IBase *)pMe->LPBoy); break; case AVK_DOWN: IIMAGE_SetParm(pMe->LPBoy_up_down,IPARM_OFFSET,0,(pMe->pi.cy/14)*(6 - (pMe->boy_infor.boy_down) )); IIMAGE_SetDrawSize(pMe->LPBoy_up_down,22,pMe->pi.cy/14); IIMAGE_Draw(pMe->LPBoy_up_down,pMe->boy_infor.x,pMe->boy_infor.y); //IBASE_Release((IBase *)pMe->LPBoy); break;default: return ;}IDISPLAY_Update(pMe->a.m_pIDisplay);}static boolean timer_HandleEvent(timer* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam){ switch (eCode) {case EVT_KEY:switch(wParam) { case AVK_UP: pMe->boy_infor.y -=3; pMe->boy_infor.boy_up++; pMe->boy_infor.boy_up = pMe->boy_infor.boy_up%3; if (SUCCESS != ISHELL_SetTimer(pMe->a.m_pIShell,100,(PFNNOTIFY)draw_boy,pMe)) { return FALSE; } break;case AVK_DOWN: pMe->boy_infor.y +=3; pMe->boy_infor.boy_down++; pMe->boy_infor.boy_down = pMe->boy_infor.boy_down%3; if (SUCCESS != ISHELL_SetTimer(pMe->a.m_pIShell,100,(PFNNOTIFY)draw_boy,pMe)) { return FALSE; } break; default: return FALSE; } return(TRUE);default: break; } return FALSE;}