当前位置: 首页>>代码示例>>Java>>正文


Java Keyboard.KEY_ESCAPE属性代码示例

本文整理汇总了Java中org.lwjgl.input.Keyboard.KEY_ESCAPE属性的典型用法代码示例。如果您正苦于以下问题:Java Keyboard.KEY_ESCAPE属性的具体用法?Java Keyboard.KEY_ESCAPE怎么用?Java Keyboard.KEY_ESCAPE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.lwjgl.input.Keyboard的用法示例。


在下文中一共展示了Keyboard.KEY_ESCAPE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_146282_l

@Override
public void func_146282_l() {
    if (Bit.getInstance() == null) {
        return;
    }
    int key = Keyboard.getEventKey();
    char cha = Keyboard.getEventCharacter();
    if (key == Keyboard.KEY_NONE) return;

    if (key == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) {
        Wrapper.displayGuiScreen(null);
        return;
    }

    if (key == Keyboard.KEY_F11) Wrapper.getMinecraft().func_71352_k();

    Iterator<Window> iter = Bit.getInstance().getClickGui().getWindows().iterator();
    while (iter.hasNext()) {
        Window comp = iter.next();
        if (Keyboard.getEventKeyState())
            comp.keyPress(key, cha);
        else
            comp.keyRelease(key, cha);
    }
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:25,代码来源:ClickGuiDisplayer.java

示例2: keyPress

@Override
public void keyPress(int key, char keyChar) {
    if (this.extended)
        this.componentList.keyPress(key, keyChar);

    if (this.binding) {
        if (key != Keyboard.KEY_NONE && key != Keyboard.KEY_ESCAPE && key != Keyboard.KEY_LSHIFT && key != Keyboard.KEY_GRAVE && key != Keyboard.KEY_RSHIFT) {
            this.mod.setKeybind(key);
            new Thread(() -> {
                if (this.title == null || mod == null) return;
                this.title = "Bound to " + Keyboard.getKeyName(key);
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                }
                if (this.title == null || mod == null) return;
                this.title = mod.getId();
            }).start();
            this.binding = false;
        }
    }
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:22,代码来源:ModComponent.java

示例3: keyTyped

@Override
protected void keyTyped(char character, int key) {
	
	if (key == Keyboard.KEY_ESCAPE)
		mc.displayGuiScreen(null);
	if (key == Keyboard.KEY_RIGHT && this.next.visible) {
		this.pageIndex++;
		this.savedIndex = pageIndex;
		NBTUtils.setInt(book, "savedIndex", savedIndex);
		updateButtons();
	}
	if (key == Keyboard.KEY_LEFT && this.prev.visible) {
		this.pageIndex--;
		this.savedIndex = pageIndex;
		NBTUtils.setInt(book, "savedIndex", savedIndex);
		updateButtons();
	}
	if (key == Keyboard.KEY_UP && this.backbutton.visible) {
		this.pageIndex = 2;
		this.savedIndex = pageIndex;
		NBTUtils.setInt(book, "savedIndex", savedIndex);
		updateButtons();
	}
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:24,代码来源:GuiBookGuide.java

示例4: keyTyped

@Override
protected void keyTyped(char c, int key) throws IOException {
    if (Widget.getFocused() == null) {
        if (key == Keyboard.KEY_ESCAPE || !justOpened && key == menuKey && key != Keyboard.KEY_NONE) {
            super.keyTyped(c, Keyboard.KEY_ESCAPE);
        } else if (key == Keyboard.KEY_DELETE) {
            Widget widget = Widget.getHovered();
            if (isElement(widget)) {
                widget.setActivated(true);
                widget.setValue(null);
            }
        }
    } else {
        Widget.getFocused().keyTyped(c, key);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:16,代码来源:ConfigMenu.java

示例5: onKey

@Override
public void onKey(KeyEvent e){
	Gui openGui=guiHandler.getOpenGui();
	if(openGui==null){
		if(e.code==Keyboard.KEY_ESCAPE){
			if(e.action==KeyAction.RELEASE) guiHandler.openGui(new GuiPause());
		}
		return;
	}
	openGui.onKey(e);
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:11,代码来源:Renderer.java

示例6: keyTyped

@Override
protected void keyTyped(char par1, int par2) throws IOException
{
	if(par2 == Keyboard.KEY_ESCAPE)
		controller.close();
	else
		super.keyTyped(par1, par2);
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:8,代码来源:EntitySetupGui.java

示例7: keyTyped

@Override
protected void keyTyped(char par1, int par2) throws IOException
{
    controller.handleMinecraftKey(par2);
    if (par2 != Keyboard.KEY_ESCAPE)
        super.keyTyped(par1, par2);
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:7,代码来源:TimelineGui.java

示例8: keyTyped

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
    super.keyTyped(typedChar, keyCode);
    if (keyCode == Keyboard.KEY_BACK) {
        if (!text.isEmpty() && cursor > 0) {
            text = text.substring(0, cursor-1) + text.substring(cursor);
            cursor--;
        }
    } else if (keyCode == Keyboard.KEY_DELETE) {
        if (cursor < text.length()) {
            text = text.substring(0, cursor) + text.substring(cursor+1);
        }
    } else if (keyCode == Keyboard.KEY_HOME) {
        cursor = 0;
    } else if (keyCode == Keyboard.KEY_END) {
        cursor = text.length();
    } else if (keyCode == Keyboard.KEY_LEFT) {
        if (cursor > 0) {
            cursor--;
        }
    } else if (keyCode == Keyboard.KEY_RIGHT) {
        if (cursor < text.length()) {
            cursor++;
        }
    } else if (keyCode == Keyboard.KEY_ESCAPE) {
        close();
    } else if (keyCode == Keyboard.KEY_RETURN) {
        destination = new TeleportDestination(text, destination.getDimension(), destination.getPos(), destination.getSide());
        MeeCreepsMessages.INSTANCE.sendToServer(new PacketSetDestination(destination, destinationIndex));
        close();
    } else if (typedChar != 0) {
        if (text.length() < 15) {
            text = text.substring(0, cursor) + typedChar + text.substring(cursor);
            cursor++;
        }
    }
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:37,代码来源:GuiAskName.java

示例9: keyTyped

public void keyTyped(char typedChar, int keyCode) throws IOException {
    if (isActive) {
        switch (keyCode) {
            case Keyboard.KEY_ESCAPE:
                isActive = false;
                break;

            case Keyboard.KEY_RETURN:
                isActive = false;
                //setValue(input);
                MC.player.sendMessage(new TextComponentString(input.toString()));
                break;

            case Keyboard.KEY_BACK:
                if (selectedIndex > -1) {
                    input.deleteCharAt(selectedIndex);
                    selectedIndex--;
                }
                break;

            case Keyboard.KEY_LEFT:
                selectedIndex--;
                break;

            case Keyboard.KEY_RIGHT:
                selectedIndex++;
                break;

            default:
                if (isValidChar(typedChar)) {
                    selectedIndex++;
                    input.insert(selectedIndex, typedChar);
                }
        }
        selectedIndex = MathHelper.clamp(selectedIndex, -1, input.length()-1);
    }
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:37,代码来源:GuiTextInput.java

示例10: processDialogKey

public void processDialogKey(int keyCode, char keyChar, boolean Event)
{
	if (Event == true && keyCode == Keyboard.KEY_ESCAPE)
		DialogOpen = false;

	switch (DialogID)
	{
		case dialogSwitchTeam:
			break;
		case dialogLeaveGame:
			if (Event == true)
			{
				if (keyCode == Keyboard.KEY_RETURN
						|| keyCode == Keyboard.KEY_Y)
				{
					System.err.println("Player has chosen to quit.");
					game.destroy();
					return;
				}
				else if (keyCode == Keyboard.KEY_N)
				{
					DialogOpen = false;
					return;
				}
			}
			break;
	}
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:28,代码来源:Dialog.java

示例11: keyTyped

@Override
  public void keyTyped(char c, int key)
  {
if (c >= '0' && c <= '9')
{
	amount = amount.concat("" + c);
}
if (key == Keyboard.KEY_BACK && amount != null && !amount.isEmpty()) {
	amount = amount.substring(0, amount.length() - 1);
}
if (key == Keyboard.KEY_RETURN) {
	AccountCapability cap = player.getCapability(Currency.ACCOUNT_DATA, null);
	if (amount != null && !amount.isEmpty() && Float.parseFloat(amount) <= 25000) {
		if (!deposit.enabled) {
			cap.addClientAmount(Float.parseFloat(amount), true);
			CurrencyUtils.depositMoney(player, Float.parseFloat(amount));
		} else if (!withdraw.enabled && Float.parseFloat(amount) <= cap.getAmount()) {
			cap.subtractClientAmount(Float.parseFloat(amount), true);
			PacketDispatcher.sendToServer(new MessageSyncDrops(player, Float.parseFloat(amount)));
		}
	}
	this.mc.displayGuiScreen((GuiScreen)null);
}
if (key == Keyboard.KEY_E || key == Keyboard.KEY_ESCAPE) {
	this.mc.displayGuiScreen((GuiScreen)null);
}
if (key == Keyboard.KEY_UP || key == Keyboard.KEY_DOWN) {
	withdraw.enabled = !withdraw.enabled;
	deposit.enabled = !deposit.enabled;
}
  }
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:31,代码来源:GuiATM.java

示例12: keyTyped

/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
@Override
protected void keyTyped(char eventChar, int eventKey)
{
    if (eventKey == Keyboard.KEY_ESCAPE)
        this.mc.displayGuiScreen(parentScreen);
    else
        this.entryList.keyTyped(eventChar, eventKey);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:GuiConfig.java

示例13: keyTyped

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
	if(keyCode == Keyboard.KEY_RETURN)
		actionPerformed(editButton.enabled ? editButton : addButton);
	else if(keyCode == Keyboard.KEY_ESCAPE)
		actionPerformed(backButton);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:8,代码来源:KeybindManagerScreen.java

示例14: keyTyped

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
	valueField.textboxKeyTyped(typedChar, keyCode);
	
	if(keyCode == Keyboard.KEY_RETURN)
		actionPerformed(doneButton);
	else if(keyCode == Keyboard.KEY_ESCAPE)
		mc.displayGuiScreen(prevScreen);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:10,代码来源:EditSliderScreen.java

示例15: keyTyped

@Override
public void keyTyped(char c, int key) {
    if (!hasFocus()) return;
    if (key == Keyboard.KEY_ESCAPE) {
        setFocused(false);
    } else if (key != Keyboard.KEY_NONE) {
        setValue(new KeyBind(key));
        setFocused(false);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:10,代码来源:KeyBinder.java


注:本文中的org.lwjgl.input.Keyboard.KEY_ESCAPE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。