<commit_before>package org.squiddev.plethora.gameplay.client.gui;

import dan200.computercraft.client.gui.widgets.WidgetTerminal;
import dan200.computercraft.shared.computer.core.IComputer;
import dan200.computercraft.shared.computer.core.IComputerContainer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.squiddev.plethora.gameplay.Plethora;
import org.squiddev.plethora.gameplay.neural.ContainerNeuralInterface;
import org.squiddev.plethora.gameplay.neural.ItemComputerHandler;
import org.squiddev.plethora.utils.Vec2i;

import java.io.IOException;
import java.util.Collections;

import static org.squiddev.plethora.gameplay.neural.ContainerNeuralInterface.*;
import static org.squiddev.plethora.gameplay.neural.ItemComputerHandler.HEIGHT;
import static org.squiddev.plethora.gameplay.neural.ItemComputerHandler.WIDTH;

public class GuiNeuralInterface extends GuiContainer {
	private static final ResourceLocation BACKGROUND = new ResourceLocation(Plethora.RESOURCE_DOMAIN, "textures/gui/neural_interface.png");
	private static final int ICON_Y = 224;

	private final IComputer computer;
	private WidgetTerminal terminalGui;
	private final ContainerNeuralInterface container;
	private boolean peripherals = true;

	public GuiNeuralInterface(ContainerNeuralInterface container) {
		super(container);

		this.container = container;
		computer = ItemComputerHandler.getClient(container.getStack());
		xSize = 254;
		ySize = 217;
	}

	@Override
	public void initGui() {
		super.initGui();

		Keyboard.enableRepeatEvents(true);
		terminalGui = new WidgetTerminal((width - xSize) / 2 + 8, (height - ySize) / 2 + 8, WIDTH, HEIGHT, new IComputerContainer() {
			@Override
			public IComputer getComputer() {
				return computer;
			}
		}, 2, 2, 2, 2);
		terminalGui.setAllowFocusLoss(false);
		updateVisible();<commit_msg>Fix repeat events not firing in neural interface<commit_after>package org.squiddev.plethora.gameplay.client.gui;

import dan200.computercraft.client.gui.widgets.WidgetTerminal;
import dan200.computercraft.shared.computer.core.IComputer;
import dan200.computercraft.shared.computer.core.IComputerContainer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.squiddev.plethora.gameplay.Plethora;
import org.squiddev.plethora.gameplay.neural.ContainerNeuralInterface;
import org.squiddev.plethora.gameplay.neural.ItemComputerHandler;
import org.squiddev.plethora.utils.Vec2i;

import java.io.IOException;
import java.util.Collections;

import static org.squiddev.plethora.gameplay.neural.ContainerNeuralInterface.*;
import static org.squiddev.plethora.gameplay.neural.ItemComputerHandler.HEIGHT;
import static org.squiddev.plethora.gameplay.neural.ItemComputerHandler.WIDTH;

public class GuiNeuralInterface extends GuiContainer {
	private static final ResourceLocation BACKGROUND = new ResourceLocation(Plethora.RESOURCE_DOMAIN, "textures/gui/neural_interface.png");
	private static final int ICON_Y = 224;

	private final IComputer computer;
	private WidgetTerminal terminalGui;
	private final ContainerNeuralInterface container;
	private boolean peripherals = true;

	public GuiNeuralInterface(ContainerNeuralInterface container) {
		super(container);

		this.container = container;
		computer = ItemComputerHandler.getClient(container.getStack());
		xSize = 254;
		ySize = 217;
	}

	@Override
	public void initGui() {
		super.initGui();

		Keyboard.enableRepeatEvents(true);
		terminalGui = new WidgetTerminal((width - xSize) / 2 + 8, (height - ySize) / 2 + 8, WIDTH, HEIGHT, new IComputerContainer() {
			@Override
			public IComputer getComputer() {
				return computer;
			}
		}, 2, 2, 2, 2);
		terminalGui.setAllowFocusLoss(false);
		updateVisible();
	}

	@Override
	public void handleInput() throws IOException {
		// JEI incorrectly sets the repeat events filter, so we force it here.
		boolean previous = Keyboard.areRepeatEventsEnabled();
		if (!previous) Keyboard.enableRepeatEvents(true);

		super.handleInput();

		if (!previous) Keyboard.enableRepeatEvents(false);
{'fraction_non_alphanumeric': 0.09589345172031076, 'fraction_numerical': 0.011986681465038845, 'mean_word_length': 5.921658986175115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4943389', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1391, 'n_words': 276}