this.mcProfiler.endStartSection("keyboard");
while (Keyboard.next()) {
int k = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
KeyBinding.setKeyBindState(k, Keyboard.getEventKeyState());
if (Keyboard.getEventKeyState()) {
KeyBinding.onTick(k);
}
if (this.debugCrashKeyPressTime > 0L) {
if (getSystemTime() - this.debugCrashKeyPressTime >= 6000L) {
throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
}
if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) {
this.debugCrashKeyPressTime = -1L;
}
} else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) {
this.debugCrashKeyPressTime = getSystemTime();
}
this.dispatchKeypresses();
if (Keyboard.getEventKeyState()) {
if (k == 62 && this.entityRenderer != null) {
this.entityRenderer.switchUseShader();
}
if (this.currentScreen != null) {
this.currentScreen.handleKeyboardInput();
} else {
int i = 0;
for (Module module : Golay.moduleManager.modules) {
if (Keyboard.getKeyIndex(module.getBind().toUpperCase()) == k) {
module.toggle();
BindGui.bL.get(i).setText(Boolean.toString(module.getOn()));
if (module.getOn()) {
BindGui.bL.get(i).setBackground(new Color(0x666666));
} else {
BindGui.bL.get(i).setBackground(new Color(0xEEEEEE));
}
}
i++;
}
if (k == 1) {
this.displayInGameMenu();
}
if (k == 32 && Keyboard.isKeyDown(61) && this.ingameGUI != null) {
this.ingameGUI.getChatGUI().clearChatMessages();
}
if (k == 31 && Keyboard.isKeyDown(61)) {
this.refreshResources();
}
if (k == 17 && Keyboard.isKeyDown(61)) {
;
}
if (k == 18 && Keyboard.isKeyDown(61)) {
;
}
if (k == 47 && Keyboard.isKeyDown(61)) {
;
}
if (k == 38 && Keyboard.isKeyDown(61)) {
;
}
if (k == 22 && Keyboard.isKeyDown(61)) {
;
}
if (k == 20 && Keyboard.isKeyDown(61)) {
this.refreshResources();
}
if (k == 33 && Keyboard.isKeyDown(61)) {
this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, GuiScreen.isShiftKeyDown() ? -1 : 1);
}
if (k == 30 && Keyboard.isKeyDown(61)) {
this.renderGlobal.loadRenderers();
}
if (k == 35 && Keyboard.isKeyDown(61)) {
this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips;
this.gameSettings.saveOptions();
}
if (k == 48 && Keyboard.isKeyDown(61)) {
this.renderManager.setDebugBoundingBox(!this.renderManager.isDebugBoundingBox());
}
if (k == 25 && Keyboard.isKeyDown(61)) {
this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus;
this.gameSettings.saveOptions();
}
if (k == 59) {
this.gameSettings.hideGUI = !this.gameSettings.hideGUI;
}
if (k == 61) {
this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo;
this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown();
this.gameSettings.field_181657_aC = GuiScreen.isAltKeyDown();
}
if (this.gameSettings.keyBindTogglePerspective.isPressed()) {
++this.gameSettings.thirdPersonView;
if (this.gameSettings.thirdPersonView > 2) {
this.gameSettings.thirdPersonView = 0;
}
if (this.gameSettings.thirdPersonView == 0) {
this.entityRenderer.loadEntityShader(this.getRenderViewEntity());
} else if (this.gameSettings.thirdPersonView == 1) {
this.entityRenderer.loadEntityShader((Entity) null);
}
this.renderGlobal.setDisplayListEntitiesDirty();
}
if (this.gameSettings.keyBindSmoothCamera.isPressed()) {
this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera;
}
}
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) {
if (k == 11) {
this.updateDebugProfilerName(0);
}
for (int j1 = 0; j1 < 9; ++j1) {
if (k == 2 + j1) {
this.updateDebugProfilerName(j1 + 1);
}
}
}
}
}