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


Java Keyboard.KEY_E属性代码示例

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


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

示例1: keyTyped

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
 
	boolean textFocused = false;
	
	for (Gui control : this.controls) {
		if (control instanceof GuiTextField) {
			GuiTextField textField = (GuiTextField) control;
			if (textField.isFocused()) {
				textFocused = true;
				textField.textboxKeyTyped(typedChar, keyCode);
				break;
			}
		}
	}

	if (!textFocused || keyCode != Keyboard.KEY_E)
		super.keyTyped(typedChar, keyCode);
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:19,代码来源:GuiContainerBase.java

示例2: keyTyped

@Override
protected void keyTyped(char c, int key) {
	if (key == Keyboard.KEY_E && this.textField.isFocused() == false) {
		mc.displayGuiScreen(null);
	}

	if (key == Keyboard.KEY_RETURN && this.textField.isFocused()) {
		mc.displayGuiScreen(null);
	}

	if (this.textField.isFocused()) {
		textField.textboxKeyTyped(c, key);
	}

	try {
		super.keyTyped(c, key);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:20,代码来源:GuiShopController.java

示例3: update

/**
 * Game loop update
 */
public void update() {
	while (Keyboard.next()) {
		if (Keyboard.getEventKeyState()) {
			if (Keyboard.getEventKey() == Keyboard.KEY_Q) {
				// play as a one off sound effect
				oggEffect.playAsSoundEffect(1.0f, 1.0f, false);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_W) {
				// replace the music thats curretly playing with 
				// the ogg
				oggStream.playAsMusic(1.0f, 1.0f, true);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_E) {
				// replace the music thats curretly playing with 
				// the mod
				modStream.playAsMusic(1.0f, 1.0f, true);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_R) {
				// play as a one off sound effect
				aifEffect.playAsSoundEffect(1.0f, 1.0f, false);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_T) {
				// play as a one off sound effect
				wavEffect.playAsSoundEffect(1.0f, 1.0f, false);
			}
		}
	}
	
	// polling is required to allow streaming to get a chance to
	// queue buffers.
	SoundStore.get().poll(0);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:35,代码来源:TestUtils.java

示例4: 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

示例5: keyTyped

@Override
public void keyTyped(char c, int key) {
	if (c >= '0' && c <= '9') {
		if (!amount.contains(".") || amount.contains(".") && amount.substring(amount.lastIndexOf(".")).length() < 3) {
			System.out.println("WHAT");
			amount = amount.concat("" + c);
		}
	}
	if (c == '.') {
		if (!amount.isEmpty() && !amount.contains(".")) {
			amount = amount.concat("" + c);
		} else if (amount.isEmpty()) {
			amount = amount.concat("0" + 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) <= 100000) {

			// 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);
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:38,代码来源:GuiStockCrate.java

示例6: keyTyped

@Override
protected void keyTyped(char c, int key) {
	if (key == Keyboard.KEY_E) {
		mc.displayGuiScreen(null);
	}

	try {
		super.keyTyped(c, key);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:12,代码来源:GuiShoppingList.java


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