本文整理匯總了Java中net.minecraft.client.gui.GuiScreen.isAltKeyDown方法的典型用法代碼示例。如果您正苦於以下問題:Java GuiScreen.isAltKeyDown方法的具體用法?Java GuiScreen.isAltKeyDown怎麽用?Java GuiScreen.isAltKeyDown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.gui.GuiScreen
的用法示例。
在下文中一共展示了GuiScreen.isAltKeyDown方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isCorrectModeActive
import net.minecraft.client.gui.GuiScreen; //導入方法依賴的package包/類
private boolean isCorrectModeActive()
{
switch (mode.toLowerCase())
{
case MODE_SHIFT:
return GuiScreen.isShiftKeyDown();
case MODE_CTRL:
return GuiScreen.isCtrlKeyDown();
case MODE_ALT:
return GuiScreen.isAltKeyDown();
case MODE_NO_SHIFT:
return !GuiScreen.isShiftKeyDown();
case MODE_NO_CTRL:
return !GuiScreen.isCtrlKeyDown();
case MODE_NO_ALT:
return !GuiScreen.isAltKeyDown();
default:
return true;
}
}
示例2: handleMouseInput
import net.minecraft.client.gui.GuiScreen; //導入方法依賴的package包/類
@Override
public void handleMouseInput() throws IOException {
int mouseX = Mouse.getEventX() * width / mc.displayWidth;
int mouseY = height - Mouse.getEventY() * height / mc.displayHeight - 1;
int button = Mouse.getEventButton();
if (Mouse.getEventButtonState()) {
//if (GuiScreen.isCtrlKeyDown()) {
if (GuiScreen.isAltKeyDown()) {
if (button == 0) {
Slot slot = getSlotAtPos(mouseX, mouseY);
if (slot != null && !slot.getStack().isEmpty()) {
if (!ItemUtils.areItemsEqual(DankNullUtils.getSelectedStack(getDankNullInventory()), slot.getStack())) {
int count = 0;
for (Slot slotHovered : inventorySlots.inventorySlots) {
count++;
if (slotHovered.equals(slot)) {
DankNullUtils.setSelectedStackIndex(getDankNullInventory(), (count - 1) - 36);
return;
}
}
}
}
}
//}
}
}
super.handleMouseInput();
}
示例3: keyTyped
import net.minecraft.client.gui.GuiScreen; //導入方法依賴的package包/類
@Override
protected void keyTyped(char par1, int par2) throws IOException {
if (par2 == Keyboard.KEY_ESCAPE) {
NetworkHandler.sendToServer(new PacketAphorismTileUpdate(tile));
} else if (par2 == Keyboard.KEY_LEFT || par2 == Keyboard.KEY_UP) {
cursorY--;
if (cursorY < 0) cursorY = textLines.length - 1;
} else if (par2 == Keyboard.KEY_DOWN || par2 == Keyboard.KEY_NUMPADENTER) {
cursorY++;
if (cursorY >= textLines.length) cursorY = 0;
} else if (par2 == Keyboard.KEY_RETURN) {
cursorY++;
textLines = ArrayUtils.add(textLines, cursorY, "");
} else if (par2 == Keyboard.KEY_BACK) {
if (textLines[cursorY].length() > 0) {
textLines[cursorY] = textLines[cursorY].substring(0, textLines[cursorY].length() - 1);
if (textLines[cursorY].endsWith("\u00a7")) {
textLines[cursorY] = textLines[cursorY].substring(0, textLines[cursorY].length() - 1);
}
} else if (textLines.length > 1) {
textLines = ArrayUtils.remove(textLines, cursorY);
cursorY--;
if (cursorY < 0) cursorY = 0;
}
} else if (par2 == Keyboard.KEY_DELETE) {
if (GuiScreen.isShiftKeyDown()) {
textLines = new String[1];
textLines[0] = "";
cursorY = 0;
} else {
if (textLines.length > 1) {
textLines = ArrayUtils.remove(textLines, cursorY);
if (cursorY > textLines.length - 1)
cursorY = textLines.length - 1;
}
}
} else if (ChatAllowedCharacters.isAllowedCharacter(par1)) {
if (GuiScreen.isAltKeyDown()) {
if (par1 >= 'a' && par1 <= 'f' || par1 >= 'l' && par1 <= 'o' || par1 == 'r' || par1 >= '0' && par1 <= '9') {
textLines[cursorY] = textLines[cursorY] + "\u00a7" + par1;
}
} else {
textLines[cursorY] = textLines[cursorY] + par1;
}
}
tile.setTextLines(textLines);
super.keyTyped(par1, par2);
}