本文整理汇总了Java中org.lwjgl.input.Keyboard.KEY_Y属性的典型用法代码示例。如果您正苦于以下问题:Java Keyboard.KEY_Y属性的具体用法?Java Keyboard.KEY_Y怎么用?Java Keyboard.KEY_Y使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.lwjgl.input.Keyboard
的用法示例。
在下文中一共展示了Keyboard.KEY_Y属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyTyped
@Override
protected void keyTyped(char key, int keyCode) throws IOException {
super.keyTyped(key, keyCode);
if (nameField.isFocused()) {
return;
}
if (Keyboard.KEY_I == keyCode && Loader.isModLoaded(ModIds.IGWMOD)) {
onIGWAction();
}
if (Keyboard.KEY_R == keyCode) {
if (exportButton.getBounds().contains(lastMouseX, lastMouseY)) {
NetworkHandler.sendToServer(new PacketGuiButton(0));
}
}
if (Keyboard.KEY_SPACE == keyCode) {
toggleShowWidgets();
}
if (Keyboard.KEY_DELETE == keyCode) {
IProgWidget widget = programmerUnit.getHoveredWidget(lastMouseX, lastMouseY);
if (widget != null) {
te.progWidgets.remove(widget);
NetworkHandler.sendToServer(new PacketProgrammerUpdate(te));
}
}
if (Keyboard.KEY_Z == keyCode) {
NetworkHandler.sendToServer(new PacketGuiButton(undoButton.id));
}
if (Keyboard.KEY_Y == keyCode) {
NetworkHandler.sendToServer(new PacketGuiButton(redoButton.id));
}
}
示例2: 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;
}
}