本文整理匯總了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));
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例12: disableKeyRepeat
import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
* Disable key repeat for this input context
*/
public void disableKeyRepeat() {
Keyboard.enableRepeatEvents(false);
}
示例13: onGuiClosed
import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
@Override
public void onGuiClosed()
{
Keyboard.enableRepeatEvents(false);
}
示例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);
}