fixed hotkey activation while typing into text fields

This commit is contained in:
LAX1DUDE 2022-07-17 20:48:12 -07:00
parent 2f3c225e79
commit e6644016a9
9 changed files with 37 additions and 5 deletions

View File

@ -1117,8 +1117,12 @@ public class Minecraft implements Runnable {
GuiMultiplayer.tickRefreshCooldown();
EaglerAdapter.tickVoice();
EaglerAdapter.activateVoice(EaglerAdapter.isKeyDown(gameSettings.voicePTTKey));
if (EaglerAdapter.getVoiceStatus() == Voice.VoiceStatus.CONNECTING || EaglerAdapter.getVoiceStatus() == Voice.VoiceStatus.CONNECTED) {
if(this.currentScreen == null || !this.currentScreen.blockHotKeys()) {
EaglerAdapter.activateVoice(EaglerAdapter.isKeyDown(gameSettings.voicePTTKey));
}
if (EaglerAdapter.getVoiceChannel() == Voice.VoiceChannel.PROXIMITY) {
if (this.theWorld != null && this.thePlayer != null) {
for (Object playerObject : this.theWorld.playerEntities) {

View File

@ -296,4 +296,8 @@ public class GuiChat extends GuiScreen {
public boolean doesGuiPauseGame() {
return false;
}
public boolean blockHotKeys() {
return true;
}
}

View File

@ -115,4 +115,8 @@ public class GuiCommandBlock extends GuiScreen {
this.commandTextField.drawTextBox();
super.drawScreen(par1, par2, par3);
}
public boolean blockHotKeys() {
return commandTextField.isFocused();
}
}

View File

@ -687,4 +687,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
static InventoryBasic getInventory() {
return inventory;
}
public boolean blockHotKeys() {
return this.searchField.isFocused();
}
}

View File

@ -144,4 +144,8 @@ public class GuiEditSign extends GuiScreen {
EaglerAdapter.glPopMatrix();
super.drawScreen(par1, par2, par3);
}
public boolean blockHotKeys() {
return true;
}
}

View File

@ -162,4 +162,8 @@ public class GuiRepair extends GuiContainer implements ICrafting {
*/
public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {
}
public boolean blockHotKeys() {
return itemNameField.isFocused();
}
}

View File

@ -264,4 +264,8 @@ public class GuiScreen extends Gui {
public static boolean isShiftKeyDown() {
return EaglerAdapter.isKeyDown(42) || EaglerAdapter.isKeyDown(54);
}
public boolean blockHotKeys() {
return false;
}
}

View File

@ -360,4 +360,8 @@ public class GuiScreenBook extends GuiScreen {
super.drawScreen(par1, par2, par3);
}
public boolean blockHotKeys() {
return this.bookIsUnsigned;
}
}

View File

@ -2278,10 +2278,10 @@ public class EaglerAdapterImpl2 {
public static final void setVoiceListenVolume(float f) {
for (GainNode gain : voiceGains.values()) {
float val = f;
if(val > 0.5) val = 0.5f + (val - 0.5f) * 2.0f;
if(val > 1.5) val = 1.5f;
if(val < 0.0) val = 0.0f;
gain.getGain().setValue(val * 3.0f);
if(val > 0.5f) val = 0.5f + (val - 0.5f) * 3.0f;
if(val > 2.0f) val = 2.0f;
if(val < 0.0f) val = 0.0f;
gain.getGain().setValue(val * 2.0f);
}
volumeListen = f;
}