Java Code Examples for org.newdawn.slick.Input#KEY_F

The following examples show how to use org.newdawn.slick.Input#KEY_F . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainMenu.java    From opsu with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void keyPressed(int key, char c) {
	if (UI.globalKeyPressed(key))
		return;

	switch (key) {
	case Input.KEY_ESCAPE:
	case Input.KEY_Q:
		((ButtonMenu) game.getState(Opsu.STATE_BUTTONMENU)).setMenuState(MenuState.EXIT);
		game.enterState(Opsu.STATE_BUTTONMENU);
		break;
	case Input.KEY_P:
		SoundController.playSound(SoundEffect.MENUHIT);
		if (logoState == LogoState.DEFAULT || logoState == LogoState.CLOSING)
			openLogoMenu();
		else
			enterSongMenu();
		break;
	case Input.KEY_D:
		SoundController.playSound(SoundEffect.MENUHIT);
		game.enterState(Opsu.STATE_DOWNLOADSMENU, new EasedFadeOutTransition(), new FadeInTransition());
		break;
	case Input.KEY_O:
		SoundController.playSound(SoundEffect.MENUHIT);
		if ((logoState == LogoState.DEFAULT || logoState == LogoState.CLOSING) &&
		    !(input.isKeyDown(Input.KEY_RCONTROL) || input.isKeyDown(Input.KEY_LCONTROL)))
			openLogoMenu();
		else {
			showOptionsOverlay = true;
			optionsOverlayProgress.setTime(0);
			optionsOverlay.activate();
			input.consumeEvent();  // don't let options overlay consume this keypress
		}
		break;
	case Input.KEY_F:
		Options.toggleFPSCounter();
		break;
	case Input.KEY_Z:
		previousTrack();
		UI.getNotificationManager().sendBarNotification("<< Prev");
		break;
	case Input.KEY_X:
		if (MusicController.isPlaying()) {
			lastMeasureProgress = 0f;
			MusicController.setPosition(0);
		} else if (!MusicController.isTrackLoading())
			MusicController.resume();
		UI.getNotificationManager().sendBarNotification("Play");
		break;
	case Input.KEY_C:
		if (MusicController.isPlaying()) {
			MusicController.pause();
			UI.getNotificationManager().sendBarNotification("Pause");
		} else if (!MusicController.isTrackLoading()) {
			MusicController.resume();
			UI.getNotificationManager().sendBarNotification("Unpause");
		}
		break;
	case Input.KEY_V:
		nextTrack(true);
		UI.getNotificationManager().sendBarNotification(">> Next");
		break;
	case Input.KEY_R:
		nextTrack(true);
		break;
	case Input.KEY_UP:
		UI.changeVolume(1);
		break;
	case Input.KEY_DOWN:
		UI.changeVolume(-1);
		break;
	}
}