static void EditFilesysVirtualLoop(void) { while(!dialogFinished) { SDL_Event event; while(SDL_PollEvent(&event)) { if (event.type == SDL_KEYDOWN) { switch(event.key.keysym.sym) { case SDLK_ESCAPE: dialogFinished = true; break; case SDLK_UP: if(HandleNavigation(DIRECTION_UP)) continue; // Don't change value when enter ComboBox -> don't send event to control break; case SDLK_DOWN: if(HandleNavigation(DIRECTION_DOWN)) continue; // Don't change value when enter ComboBox -> don't send event to control break; case SDLK_LEFT: if(HandleNavigation(DIRECTION_LEFT)) continue; // Don't change value when enter Slider -> don't send event to control break; case SDLK_RIGHT: if(HandleNavigation(DIRECTION_RIGHT)) continue; // Don't change value when enter Slider -> don't send event to control break; case SDLK_PAGEDOWN: case SDLK_HOME: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up break; } } //------------------------------------------------- // Send event to guichan-controls //------------------------------------------------- gui_input->pushInput(event); } // Now we let the Gui object perform its logic. uae_gui->logic(); // Now we let the Gui object draw itself. uae_gui->draw(); // Finally we update the screen. SDL_Flip(gui_screen); } }
void Menu::Render() { unsigned long now = millis(); if (now - m_buttonsChanged > m_idleTimeout && m_currentButtons == 0 && m_idle != NULL && !m_idleActive) { // no button pressed // idle timeout exceeded -> activate idle m_idleActive = true; m_current = NULL; } HandleNavigation(); if (m_idleActive && m_idle != NULL) { m_idle->Render(*m_lcd, m_cols, m_rows); } else if (m_current != NULL) { m_current->Render(*m_lcd, m_cols, m_rows); } }