Java Code Examples for org.lwjgl.glfw.GLFW#GLFW_KEY_ESCAPE

The following examples show how to use org.lwjgl.glfw.GLFW#GLFW_KEY_ESCAPE . 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: EnterProfileNameScreen.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	switch(keyCode)
	{
		case GLFW.GLFW_KEY_ENTER:
		done();
		break;
		
		case GLFW.GLFW_KEY_ESCAPE:
		client.openScreen(prevScreen);
		break;
	}
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 2
Source File: EditBlockScreen.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	switch(keyCode)
	{
		case GLFW.GLFW_KEY_ENTER:
		done();
		break;
		
		case GLFW.GLFW_KEY_ESCAPE:
		client.openScreen(prevScreen);
		break;
	}
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 3
Source File: EditSliderScreen.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	switch(keyCode)
	{
		case GLFW.GLFW_KEY_ENTER:
		done();
		break;
		
		case GLFW.GLFW_KEY_ESCAPE:
		client.openScreen(prevScreen);
		break;
	}
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 4
Source File: CottonInventoryScreen.java    From LibGui with MIT License 6 votes vote down vote up
@Override
public boolean keyPressed(int ch, int keyCode, int modifiers) {
	//System.out.println("Key " + Integer.toHexString(ch)+" "+Integer.toHexString(keyCode));
	if (ch==GLFW.GLFW_KEY_ESCAPE) {
		this.client.player.closeHandledScreen();
		return true;
	} else if (ch==GLFW.GLFW_KEY_TAB) {
		changeFocus(!hasShiftDown());
		return true;
	} else {
		//if (super.keyPressed(ch, keyCode, modifiers)) return true;
		if (description.getFocus()==null) {
			if (MinecraftClient.getInstance().options.keyInventory.matchesKey(ch, keyCode)) {
				this.client.player.closeHandledScreen();
				return true;
			}
			return false;
		} else {
			description.getFocus().onKeyPressed(ch, keyCode, modifiers);
			return true;
		}
	}
}
 
Example 5
Source File: GuiSprint.java    From Better-Sprinting with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers){
	if (selectedBinding != null){
		if (keyCode == GLFW.GLFW_KEY_ESCAPE){
			selectedBinding.setBinding(KeyModifier.NONE, InputMappings.INPUT_INVALID);
		}
		else{
			selectedBinding.setBinding(KeyModifier.getActiveModifier(), InputMappings.getInputByCode(keyCode, scanCode));
		}
		
		onSelectedBindingUpdated();
		return true;
	}
	else{
		return super.keyPressed(keyCode, scanCode, modifiers);
	}
}
 
Example 6
Source File: KeybindManagerScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	if(keyCode == GLFW.GLFW_KEY_ENTER)
		if(editButton.active)
			editButton.onPress();
		else
			addButton.onPress();
	else if(keyCode == GLFW.GLFW_KEY_DELETE)
		removeButton.onPress();
	else if(keyCode == GLFW.GLFW_KEY_ESCAPE)
		backButton.onPress();
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 7
Source File: PressAKeyScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	if(keyCode != GLFW.GLFW_KEY_ESCAPE)
		prevScreen.setKey(getKeyName(keyCode, scanCode));
	
	client.openScreen((Screen)prevScreen);
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 8
Source File: KeybindProfilesScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	if(keyCode == GLFW.GLFW_KEY_ENTER)
		loadSelected();
	else if(keyCode == GLFW.GLFW_KEY_ESCAPE)
		openPrevScreen();
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 9
Source File: EditBlockListScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	if(keyCode == GLFW.GLFW_KEY_ENTER)
		addButton.onPress();
	else if(keyCode == GLFW.GLFW_KEY_DELETE)
		removeButton.onPress();
	else if(keyCode == GLFW.GLFW_KEY_ESCAPE)
		doneButton.onPress();
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 10
Source File: SelectFileScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	if(keyCode == GLFW.GLFW_KEY_ENTER)
		done();
	else if(keyCode == GLFW.GLFW_KEY_ESCAPE)
		openPrevScreen();
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 11
Source File: EditItemListScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean keyPressed(int keyCode, int scanCode, int int_3)
{
	if(keyCode == GLFW.GLFW_KEY_ENTER)
		addButton.onPress();
	else if(keyCode == GLFW.GLFW_KEY_DELETE)
		removeButton.onPress();
	else if(keyCode == GLFW.GLFW_KEY_ESCAPE)
		doneButton.onPress();
	
	return super.keyPressed(keyCode, scanCode, int_3);
}
 
Example 12
Source File: NavigatorFeatureScreen.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onKeyPress(int keyCode, int scanCode, int int_3)
{
	if(keyCode == GLFW.GLFW_KEY_ESCAPE)
	{
		parent.setExpanding(false);
		client.openScreen(parent);
	}
}