FabricMC/yarn

The Mouse#controlLeftTicks field is incremented by mouse actions rather than ticks

haykam821 opened this issue · 0 comments

The relevant code is a mouse button callback in the Mouse class, rather than a tick method:

private void onMouseButton(long window, int button, int action, int mods) {
	// ...

	boolean press = action == GLFW.GLFW_PRESS;

	if (MinecraftClient.IS_SYSTEM_MAC && button == GLFW.GLFW_MOUSE_BUTTON_1) {
		if (press) {
			if ((mods & GLFW.GLFW_MOD_CONTROL) == GLFW.GLFW_MOD_CONTROL) {
				button = GLFW.GLFW_MOUSE_BUTTON_2;
				++this.controlLeftTicks;
			}
		} else if (this.controlLeftTicks > 0) {
			button = GLFW.GLFW_MOUSE_BUTTON_2;
			--this.controlLeftTicks;
		}
	}

	// ...
}