當前位置: 首頁>>代碼示例>>Java>>正文


Java Keyboard.enableRepeatEvents方法代碼示例

本文整理匯總了Java中org.lwjgl.input.Keyboard.enableRepeatEvents方法的典型用法代碼示例。如果您正苦於以下問題:Java Keyboard.enableRepeatEvents方法的具體用法?Java Keyboard.enableRepeatEvents怎麽用?Java Keyboard.enableRepeatEvents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.input.Keyboard的用法示例。


在下文中一共展示了Keyboard.enableRepeatEvents方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    if (this.mc.playerController.isInCreativeMode())
    {
        super.initGui();
        this.buttonList.clear();
        Keyboard.enableRepeatEvents(true);
        this.searchField = new GuiTextField(0, this.fontRendererObj, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRendererObj.FONT_HEIGHT);
        this.searchField.setMaxStringLength(15);
        this.searchField.setEnableBackgroundDrawing(false);
        this.searchField.setVisible(false);
        this.searchField.setTextColor(16777215);
        int i = selectedTabIndex;
        selectedTabIndex = -1;
        this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
        this.field_147059_E = new CreativeCrafting(this.mc);
        this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_147059_E);
    }
    else
    {
        this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:28,代碼來源:GuiContainerCreative.java

示例2: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
@Override
public void initGui()
{
    Keyboard.enableRepeatEvents(true);

    this.guiLeft = (this.width - this.xSize) / 2;
    this.guiTop = (this.height - this.ySize) / 2;

    buttonList.clear();
    buttonList.add(new GuiButton(ID_CONFIRM, guiLeft + (xSize - 50) / 2, guiTop + ySize + 2, 50, 20, I18n.translateToLocal("gui.done")));

    channels = new ArrayList<>();
    for(TileEntity te : Minecraft.getMinecraft().world.loadedTileEntityList)
    {
        if(te instanceof TileEntityGlassMaster && (((TileEntityGlassMaster)te).setChannel.isEmpty() || ((TileEntityGlassMaster)te).setChannel.startsWith("public:") || ((TileEntityGlassMaster)te).setChannel.startsWith(Minecraft.getMinecraft().player.getName())))
        {
            channels.add((TileEntityGlassMaster)te);
        }
    }
    trackList = new GuiProjectorList(this, xSize - 10, ySize - 22, guiTop + 11, guiTop + ySize - 5, guiLeft + 5, 8, channels);
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:22,代碼來源:GuiProjectorSetter.java

示例3: onGuiClosed

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    super.onGuiClosed();

    if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null)
    {
        this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_147059_E);
    }

    Keyboard.enableRepeatEvents(false);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:GuiContainerCreative.java

示例4: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectServer.select", new Object[0])));
    this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
    this.field_146302_g = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 116, 200, 20);
    this.field_146302_g.setMaxStringLength(128);
    this.field_146302_g.setFocused(true);
    this.field_146302_g.setText(this.mc.gameSettings.lastServer);
    ((GuiButton)this.buttonList.get(0)).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:17,代碼來源:GuiScreenServerList.java

示例5: keyTyped

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
 */
@Override
protected void keyTyped(char par1, int par2) throws IOException {
    if (par2 == 1) {
        Keyboard.enableRepeatEvents(false);
        mc.displayGuiScreen(parentScreen);
        onGuiClosed();
    } else {
        super.keyTyped(par1, par2);
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:14,代碼來源:GuiPastebin.java

示例6: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    this.doneBtn = this.addButton(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, I18n.format("gui.done", new Object[0])));
    this.tileSign.setEditable(false);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:12,代碼來源:GuiEditSign.java

示例7: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectServer.select", new Object[0])));
    this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
    this.ipEdit = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 116, 200, 20);
    this.ipEdit.setMaxStringLength(128);
    this.ipEdit.setFocused(true);
    this.ipEdit.setText(this.mc.gameSettings.lastServer);
    ((GuiButton)this.buttonList.get(0)).enabled = !this.ipEdit.getText().isEmpty() && this.ipEdit.getText().split(":").length > 0;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:17,代碼來源:GuiScreenServerList.java

示例8: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("selectWorld.create", new Object[0])));
    this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0])));
    this.btnGameMode = this.addButton(new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.format("selectWorld.gameMode", new Object[0])));
    this.btnMoreOptions = this.addButton(new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.format("selectWorld.moreWorldOptions", new Object[0])));
    this.btnMapFeatures = this.addButton(new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.mapFeatures", new Object[0])));
    this.btnMapFeatures.visible = false;
    this.btnBonusItems = this.addButton(new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.format("selectWorld.bonusItems", new Object[0])));
    this.btnBonusItems.visible = false;
    this.btnMapType = this.addButton(new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.mapType", new Object[0])));
    this.btnMapType.visible = false;
    this.btnAllowCommands = this.addButton(new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.format("selectWorld.allowCommands", new Object[0])));
    this.btnAllowCommands.visible = false;
    this.btnCustomizeType = this.addButton(new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.format("selectWorld.customizeType", new Object[0])));
    this.btnCustomizeType.visible = false;
    this.worldNameField = new GuiTextField(9, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
    this.worldNameField.setFocused(true);
    this.worldNameField.setText(this.worldName);
    this.worldSeedField = new GuiTextField(10, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
    this.worldSeedField.setText(this.worldSeed);
    this.showMoreWorldOptions(this.inMoreWorldOptionsDisplay);
    this.calcSaveDirName();
    this.updateDisplayState();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:32,代碼來源:GuiCreateWorld.java

示例9: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
public void initGui()
{
	Keyboard.enableRepeatEvents(true);
	buttonList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Login"));
	buttonList.add(new GuiButton(2, width / 2 - 100, height / 4 + 96 + 36, "Back"));
	usernameBox = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, 76 - 25, 200, 20);
	passwordBox = new GuiPasswordField(2, this.fontRendererObj, width / 2 - 100, 116 - 25, 200, 20);
	usernameBox.setMaxStringLength(200);
	passwordBox.setMaxStringLength(200);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:11,代碼來源:GuiDirectLogin.java

示例10: initGui

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.doneButton = this.addButton(new GuiButton(0, this.width / 2 - 4 - 150, 210, 150, 20, I18n.format("gui.done", new Object[0])));
    this.cancelButton = this.addButton(new GuiButton(1, this.width / 2 + 4, 210, 150, 20, I18n.format("gui.cancel", new Object[0])));
    this.saveButton = this.addButton(new GuiButton(9, this.width / 2 + 4 + 100, 185, 50, 20, I18n.format("structure_block.button.save", new Object[0])));
    this.loadButton = this.addButton(new GuiButton(10, this.width / 2 + 4 + 100, 185, 50, 20, I18n.format("structure_block.button.load", new Object[0])));
    this.modeButton = this.addButton(new GuiButton(18, this.width / 2 - 4 - 150, 185, 50, 20, "MODE"));
    this.detectSizeButton = this.addButton(new GuiButton(19, this.width / 2 + 4 + 100, 120, 50, 20, I18n.format("structure_block.button.detect_size", new Object[0])));
    this.showEntitiesButton = this.addButton(new GuiButton(20, this.width / 2 + 4 + 100, 160, 50, 20, "ENTITIES"));
    this.mirrorButton = this.addButton(new GuiButton(21, this.width / 2 - 20, 185, 40, 20, "MIRROR"));
    this.showAirButton = this.addButton(new GuiButton(22, this.width / 2 + 4 + 100, 80, 50, 20, "SHOWAIR"));
    this.showBoundingBoxButton = this.addButton(new GuiButton(23, this.width / 2 + 4 + 100, 80, 50, 20, "SHOWBB"));
    this.rotateZeroDegreesButton = this.addButton(new GuiButton(11, this.width / 2 - 1 - 40 - 1 - 40 - 20, 185, 40, 20, "0"));
    this.rotateNinetyDegreesButton = this.addButton(new GuiButton(12, this.width / 2 - 1 - 40 - 20, 185, 40, 20, "90"));
    this.rotate180DegreesButton = this.addButton(new GuiButton(13, this.width / 2 + 1 + 20, 185, 40, 20, "180"));
    this.rotate270DegressButton = this.addButton(new GuiButton(14, this.width / 2 + 1 + 40 + 1 + 20, 185, 40, 20, "270"));
    this.nameEdit = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 152, 40, 300, 20);
    this.nameEdit.setMaxStringLength(64);
    this.nameEdit.setText(this.tileStructure.getName());
    this.tabOrder.add(this.nameEdit);
    BlockPos blockpos = this.tileStructure.getPosition();
    this.posXEdit = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 152, 80, 80, 20);
    this.posXEdit.setMaxStringLength(15);
    this.posXEdit.setText(Integer.toString(blockpos.getX()));
    this.tabOrder.add(this.posXEdit);
    this.posYEdit = new GuiTextField(4, this.fontRendererObj, this.width / 2 - 72, 80, 80, 20);
    this.posYEdit.setMaxStringLength(15);
    this.posYEdit.setText(Integer.toString(blockpos.getY()));
    this.tabOrder.add(this.posYEdit);
    this.posZEdit = new GuiTextField(5, this.fontRendererObj, this.width / 2 + 8, 80, 80, 20);
    this.posZEdit.setMaxStringLength(15);
    this.posZEdit.setText(Integer.toString(blockpos.getZ()));
    this.tabOrder.add(this.posZEdit);
    BlockPos blockpos1 = this.tileStructure.getStructureSize();
    this.sizeXEdit = new GuiTextField(6, this.fontRendererObj, this.width / 2 - 152, 120, 80, 20);
    this.sizeXEdit.setMaxStringLength(15);
    this.sizeXEdit.setText(Integer.toString(blockpos1.getX()));
    this.tabOrder.add(this.sizeXEdit);
    this.sizeYEdit = new GuiTextField(7, this.fontRendererObj, this.width / 2 - 72, 120, 80, 20);
    this.sizeYEdit.setMaxStringLength(15);
    this.sizeYEdit.setText(Integer.toString(blockpos1.getY()));
    this.tabOrder.add(this.sizeYEdit);
    this.sizeZEdit = new GuiTextField(8, this.fontRendererObj, this.width / 2 + 8, 120, 80, 20);
    this.sizeZEdit.setMaxStringLength(15);
    this.sizeZEdit.setText(Integer.toString(blockpos1.getZ()));
    this.tabOrder.add(this.sizeZEdit);
    this.integrityEdit = new GuiTextField(15, this.fontRendererObj, this.width / 2 - 152, 120, 80, 20);
    this.integrityEdit.setMaxStringLength(15);
    this.integrityEdit.setText(this.decimalFormat.format((double)this.tileStructure.getIntegrity()));
    this.tabOrder.add(this.integrityEdit);
    this.seedEdit = new GuiTextField(16, this.fontRendererObj, this.width / 2 - 72, 120, 80, 20);
    this.seedEdit.setMaxStringLength(31);
    this.seedEdit.setText(Long.toString(this.tileStructure.getSeed()));
    this.tabOrder.add(this.seedEdit);
    this.dataEdit = new GuiTextField(17, this.fontRendererObj, this.width / 2 - 152, 120, 240, 20);
    this.dataEdit.setMaxStringLength(128);
    this.dataEdit.setText(this.tileStructure.getMetadata());
    this.tabOrder.add(this.dataEdit);
    this.mirror = this.tileStructure.getMirror();
    this.updateMirrorButton();
    this.rotation = this.tileStructure.getRotation();
    this.updateDirectionButtons();
    this.mode = this.tileStructure.getMode();
    this.updateMode();
    this.ignoreEntities = this.tileStructure.ignoresEntities();
    this.updateEntitiesButton();
    this.showAir = this.tileStructure.showsAir();
    this.updateToggleAirButton();
    this.showBoundingBox = this.tileStructure.showsBoundingBox();
    this.updateToggleBoundingBox();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:78,代碼來源:GuiEditStructure.java

示例11: onGuiClosed

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Called when the screen is unloaded. Used to disable keyboard repeat events
 */
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:8,代碼來源:GuiCommandBlock.java

示例12: disableKeyRepeat

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Disable key repeat for this input context
 */
public void disableKeyRepeat() {
	Keyboard.enableRepeatEvents(false);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:7,代碼來源:Input.java

示例13: onGuiClosed

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
@Override
public void onGuiClosed()
{
    Keyboard.enableRepeatEvents(false);
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:6,代碼來源:GuiChannelSetterProjector.java

示例14: enableKeyRepeat

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Enable key repeat for this input context. Uses the system settings for repeat
 * interval configuration.
 */
public void enableKeyRepeat() {
	Keyboard.enableRepeatEvents(true);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:8,代碼來源:Input.java


注:本文中的org.lwjgl.input.Keyboard.enableRepeatEvents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。