@Override public boolean isKeyDown(int key) { return Keyboard.isKeyDown(key); }
public boolean isKeyPressed (int key) { if (!Keyboard.isCreated()) return false; if (key == Input.Keys.ANY_KEY) return pressedKeys > 0; else return Keyboard.isKeyDown(getLwjglKeyCode(key)); }
public boolean isKeyPressed (int key) { if (!Keyboard.isCreated()) return false; if (key == Input.Keys.ANY_KEY) return pressedKeys > 0; else return Keyboard.isKeyDown(getLwjglKeyCode(key)); }
public static boolean isCtrlKeyDown() { // prioritize CONTROL, but allow OPTION as well on Mac (note: GuiScreen's isCtrlKeyDown only checks for the OPTION key on Mac) boolean isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); if(!isCtrlKeyDown && Minecraft.IS_RUNNING_ON_MAC) { isCtrlKeyDown = Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA); } return isCtrlKeyDown; }
@SubscribeEvent public void onTick(ClientTickEvent event) { if(event.phase != Phase.END) return; GuiScreen screen = Minecraft.getMinecraft().currentScreen; if(!(screen instanceof GuiChat)) { isAutoCompleted = false; return; } GuiChat chat = (GuiChat) screen; if(isAutoCompleted) { boolean valid = false;//ReflectionHelper.getPrivateValue(GuiChat.class, chat, LibObfuscation.COMPLETE_FLAG); if(!valid) isAutoCompleted = false; } if(Keyboard.isKeyDown(15)) { if(tabLastTick) return; tabLastTick = true; } else { tabLastTick = false; return; } if(!CorporeaHelper.shouldAutoComplete()) return; if(!isAutoCompleted) buildAutoCompletes(chat.inputField, chat); if(isAutoCompleted && !completions.isEmpty()) advanceAutoComplete(chat.inputField, chat); }
@Override public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity ) { boolean shiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT ); if( shiftHeld ) { ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem(); ItemStack output = iep.getOutput( stack ); if( !output.isEmpty() ) { IBakedModel realModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel( output ); // Give the item model a chance to handle the overrides as well realModel = realModel.getOverrides().handleItemState( realModel, output, world, entity ); return new ShiftHoldingModelWrapper( realModel ); } } return ItemEncodedPatternBakedModel.this.baseModel.getOverrides().handleItemState( originalModel, stack, world, entity ); } }
/** * Check if a particular key is down * * @param code The key code of the key to check * @return True if the key is down */ public boolean isKeyDown(int code) { return Keyboard.isKeyDown(code); }
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag advancedToolTip) { super.addInformation(itemStack, player, list, advancedToolTip); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { list.add("This machine smelts resonating ore and produces liquid"); list.add("crystal in a tank placed on top of this."); list.add("Below the smelter place a tank about half-filled with lava"); } else { list.add(TextFormatting.WHITE + ClientHandler.getShiftMessage()); } }
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag advancedToolTip) { super.addInformation(itemStack, player, list, advancedToolTip); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { list.add("Place this block on a tank and aim an"); list.add("infusion laser at it to enhance the liquid"); list.add("in the tank"); } else { list.add(TextFormatting.WHITE + ClientHandler.getShiftMessage()); } }
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag advancedToolTip) { super.addInformation(itemStack, player, list,advancedToolTip); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { list.add("This machine will transfer fluids from the upper tank"); list.add("to a tank below if the fluid matches certain conditions"); } else { list.add(TextFormatting.WHITE + ClientHandler.getShiftMessage()); } }
private void modifyAmount(int amount) { if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { amount *= 100; } NetworkUtil.sendToServer(new PacketPartConfig(part, PacketPartConfig.FLUID_EMITTER_AMOUNT_CHANGE, Integer.toString(amount))); }
public boolean isKeyDown(KeyBinding keybind) { int key = keybind.getKeyCode(); if(key < 0) { int button = 100 + key; return Mouse.isButtonDown(button); } return Keyboard.isKeyDown(key); }
public boolean isKeyPressed (int key) { if (!Keyboard.isCreated()) return false; if (key == Input.Keys.ANY_KEY) return pressedKeys > 0; else return Keyboard.isKeyDown(getLwjglKeyCode(key)); }
if( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) )
@Override boolean renderKey(Minecraft mc, boolean canHover, CoordinateHolder c) { boolean hovered = (canHover && isHovered(c)) || Keyboard.isKeyDown(getKey(clicks)); int u = 320 + w * type; int v = hovered ? h : 0; drawModalRectWithCustomSizedTexture(c.baseX + x, c.baseY + y, u, v, w, h, TEXTURE_WIDTH, TEXTURE_HEIGHT); if(hovered) renderNote(mc, c); return hovered; }
@Override boolean renderKey(Minecraft mc, boolean canHover, CoordinateHolder c) { boolean hovered = (canHover && isHovered(c)) || Keyboard.isKeyDown(getKey(clicks)); int u = 374; int v = hovered ? h : 0; drawModalRectWithCustomSizedTexture(c.baseX + x, c.baseY + y, u, v, w, h, TEXTURE_WIDTH, TEXTURE_HEIGHT); if(hovered) renderNote(mc, c); return hovered; }
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) { super.addInformation(stack, worldIn, tooltip, flagIn); if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { FluidIdentifierStack fluidStack = SimpleServiceLocator.logisticsFluidManager.getFluidFromContainer(ItemIdentifierStack.getFromStack(stack)); if (fluidStack != null) { tooltip.add("Type: " + fluidStack.makeFluidStack().getFluid().getLocalizedName(fluidStack.makeFluidStack())); tooltip.add("Value: " + fluidStack.getAmount() + "mB"); } } }