/// <summary> /// Responds to user input, changing the selected entry and accepting /// or cancelling the menu. /// </summary> public override void HandleInput(InputState input) { // Move to the previous menu entry? if (input.MenuUp) { selectedEntry--; if (selectedEntry < 0) selectedEntry = menuEntries.Count - 1; //AudioManager.PlaySoundEffect("menu_scroll"); } // Move to the next menu entry? if (input.MenuDown) { selectedEntry++; if (selectedEntry >= menuEntries.Count) selectedEntry = 0; //AudioManager.PlaySoundEffect("menu_scroll"); } // Accept or cancel the menu? if (input.MenuSelect) { //AudioManager.PlaySoundEffect("menu_select"); OnSelectEntry(selectedEntry); } else if (input.MenuCancel) { OnCancel(); } }
public override void HandleInput(InputState input) { if (input.IsNewKeyPress(Keys.Enter) && input.CurrentKeyboardState.IsKeyDown(Keys.LeftControl)) { var gdm = ((ScummGame)game).GraphicsDeviceManager; gdm.ToggleFullScreen(); gdm.ApplyChanges(); } else if (input.IsNewKeyPress(Keys.Space)) { engine.IsPaused = !engine.IsPaused; } else { inputManager.UpdateInput(input.CurrentKeyboardState); cursorPos = inputManager.RealPosition; base.HandleInput(input); } }
/// <summary> /// Allows the screen to handle user input. Unlike Update, this method /// is only called when the screen is active, and not when some other /// screen has taken the focus. /// </summary> public virtual void HandleInput(InputState input) { }