org.lwjgl.input.Mouse.isButtonDown()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.lwjgl.input.Mouse.isButtonDown()方法的一些代码示例,展示了Mouse.isButtonDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mouse.isButtonDown()方法的具体详情如下:
包路径:org.lwjgl.input.Mouse
类名称:Mouse
方法名:isButtonDown

Mouse.isButtonDown介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public boolean isTouched () {
  boolean button = Mouse.isButtonDown(0) || Mouse.isButtonDown(1) || Mouse.isButtonDown(2);
  return button;
}

代码示例来源:origin: libgdx/libgdx

public boolean isTouched () {
  boolean button = Mouse.isButtonDown(0) || Mouse.isButtonDown(1) || Mouse.isButtonDown(2);
  return button;
}

代码示例来源:origin: MovingBlocks/Terasology

@Override
public boolean isButtonDown(int button) {
  return Mouse.isButtonDown(button);
}

代码示例来源:origin: libgdx/libgdx

@Override
public boolean isButtonPressed (int button) {
  return Mouse.isButtonDown(toLwjglButton(button));
}

代码示例来源:origin: libgdx/libgdx

@Override
public boolean isButtonPressed (int button) {
  return Mouse.isButtonDown(toLwjglButton(button));
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( final GuiButton btn ) throws IOException
{
  super.actionPerformed( btn );
  final boolean backwards = Mouse.isButtonDown( 1 );
  if( this.mode == btn )
  {
    NetworkHandler.instance().sendToServer( new PacketConfigButton( Settings.CONDENSER_OUTPUT, backwards ) );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( final GuiButton btn ) throws IOException
{
  super.actionPerformed( btn );
  final boolean backwards = Mouse.isButtonDown( 1 );
  if( btn == this.units )
  {
    AEConfig.instance().nextPowerUnit( backwards );
    this.units.set( AEConfig.instance().selectedPowerUnit() );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( final GuiButton btn ) throws IOException
{
  super.actionPerformed( btn );
  final boolean backwards = Mouse.isButtonDown( 1 );
  if( btn == this.units )
  {
    AEConfig.instance().nextPowerUnit( backwards );
    this.units.set( AEConfig.instance().selectedPowerUnit() );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( final GuiButton btn ) throws IOException
{
  super.actionPerformed( btn );
  final boolean backwards = Mouse.isButtonDown( 1 );
  if( btn == this.units )
  {
    AEConfig.instance().nextPowerUnit( backwards );
    this.units.set( AEConfig.instance().selectedPowerUnit() );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
  protected void actionPerformed( final GuiButton btn ) throws IOException
  {
    super.actionPerformed( btn );

    final boolean backwards = Mouse.isButtonDown( 1 );

    if( btn == this.priority )
    {
      NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
    }
    else if( btn == this.placeMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.placeMode.getSetting(), backwards ) );
    }
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
  protected void actionPerformed( final GuiButton btn ) throws IOException
  {
    super.actionPerformed( btn );

    final boolean backwards = Mouse.isButtonDown( 1 );

    if( btn == this.fullMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
    }

    if( btn == this.operationMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
    }
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( final GuiButton btn ) throws IOException
{
  super.actionPerformed( btn );
  final boolean backwards = Mouse.isButtonDown( 1 );
  if( btn == this.selectCPU )
  {
    try
    {
      NetworkHandler.instance().sendToServer( new PacketValueConfig( "Terminal.Cpu", backwards ? "Prev" : "Next" ) );
    }
    catch( final IOException e )
    {
      AELog.debug( e );
    }
  }
  if( btn == this.originalGuiBtn )
  {
    NetworkHandler.instance().sendToServer( new PacketSwitchGuis( this.originalGui ) );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( GuiButton btn ) throws IOException
{
  if( btn instanceof GuiImgButton )
  {
    final boolean backwards = Mouse.isButtonDown( 1 );
    final GuiImgButton iBtn = (GuiImgButton) btn;
    if( iBtn.getSetting() != Settings.ACTIONS )
    {
      final Enum cv = iBtn.getCurrentValue();
      final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
      try
      {
        NetworkHandler.instance().sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
      }
      catch( final IOException e )
      {
        AELog.debug( e );
      }
      iBtn.set( next );
    }
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
  protected void actionPerformed( final GuiButton btn ) throws IOException
  {
    super.actionPerformed( btn );

    final boolean backwards = Mouse.isButtonDown( 1 );

    if( btn == this.priority )
    {
      NetworkHandler.instance().sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
    }

    if( btn == this.interfaceMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
    }

    if( btn == this.BlockMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
    }
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void actionPerformed( final GuiButton btn ) throws IOException
{
  super.actionPerformed( btn );
  final boolean backwards = Mouse.isButtonDown( 1 );
  if( btn == this.craftingMode )
  {
    NetworkHandler.instance().sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
  }
  if( btn == this.levelMode )
  {
    NetworkHandler.instance().sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
  }
  final boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
  final boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
  if( isPlus || isMinus )
  {
    this.addQty( this.getQty( btn ) );
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
  protected void actionPerformed( final GuiButton btn ) throws IOException
  {
    super.actionPerformed( btn );

    final boolean backwards = Mouse.isButtonDown( 1 );

    if( btn == this.redstoneMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
    }

    if( btn == this.craftMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
    }

    if( btn == this.fuzzyMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
    }

    if( btn == this.schedulingMode )
    {
      NetworkHandler.instance().sendToServer( new PacketConfigButton( this.schedulingMode.getSetting(), backwards ) );
    }
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

final boolean backwards = Mouse.isButtonDown( 1 );

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

final boolean backwards = Mouse.isButtonDown( 1 );

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

final boolean backwards = Mouse.isButtonDown( 1 );

代码示例来源:origin: Vazkii/Botania

@SideOnly(Side.CLIENT)
public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack) {
  RenderItem render = Minecraft.getMinecraft().getRenderItem();
  boolean mouseDown = Mouse.isButtonDown(0);
  GlStateManager.pushMatrix();
  GlStateManager.enableBlend();
  GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  RenderHelper.enableGUIStandardItemLighting();
  GlStateManager.enableRescaleNormal();
  GlStateManager.enableDepth();
  render.renderItemAndEffectIntoGUI(stack, xPos, yPos);
  render.renderItemOverlays(Minecraft.getMinecraft().fontRenderer, stack, xPos, yPos);
  RenderHelper.disableStandardItemLighting();
  GlStateManager.popMatrix();
  if(relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) {
    tooltipStack = stack;
    EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack);
    if(data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn())) {
      tooltipEntry = true;
      if(!mouseDownLastTick && mouseDown && GuiScreen.isShiftKeyDown()) {
        GuiLexiconEntry newGui = new GuiLexiconEntry(data.entry, (GuiScreen) gui);
        newGui.page = data.page;
        Minecraft.getMinecraft().displayGuiScreen(newGui);
      }
    }
  }
  GlStateManager.disableLighting();
}

相关文章