local H=require(script.Parent:WaitForChild("\066\097\115\101\067\104\097\114\097\099\116\101\114\067\111\110\116\114\111\108\108\101\114"))local o=setmetatable({},H)o.__index=o function o.new()local f=setmetatable(H.new(),o)f.textFocusReleasedConn=nil f.textFocusGainedConn=nil f.windowFocusReleasedConn=nil f.forwardValue=0 f.backwardValue=0 f.leftValue=0 f.rightValue=0 return f end local f=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local Z=Vector3.new(0,0,0)function o.Enable(H,o)if not f.KeyboardEnabled then return false end if o==H.enabled then return true end H.forwardValue=0 H.backwardValue=0 H.leftValue=0 H.rightValue=0 H.moveVector=Z H.isJumping=false if o then H:BindContextActions()H:ConnectFocusEventListeners()else H:UnbindContextActions()H:DisconnectFocusEventListeners()end H.enabled=o return true end function o.UpdateMovement(H,o)if o==Enum.UserInputState.Cancel then H.moveVector=Z return end H.moveVector=Vector3.new(H.leftValue+H.rightValue,0,H.forwardValue+H.backwardValue)end local m=game:GetService("\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")function o.BindContextActions(H)m:BindAction("\109\111\118\101\070\111\114\119\097\114\100\065\099\116\105\111\110",function(o,f,Z)if f==Enum.UserInputState.Begin then local H=-1 else v4=0 end H.forwardValue=v4 H:UpdateMovement(f)end,false,Enum.PlayerActions.CharacterForward)m:BindAction("\109\111\118\101\066\097\099\107\119\097\114\100\065\099\116\105\111\110",function(o,f,Z)if f==Enum.UserInputState.Begin then local H=1 else v5=0 end H.backwardValue=v5 H:UpdateMovement(f)end,false,Enum.PlayerActions.CharacterBackward)m:BindAction("\109\111\118\101\076\101\102\116\065\099\116\105\111\110",function(o,f,Z)if f==Enum.UserInputState.Begin then local H=-1 else v6=0 end H.leftValue=v6 H:UpdateMovement(f)end,false,Enum.PlayerActions.CharacterLeft)m:BindAction("\109\111\118\101\082\105\103\104\116\065\099\116\105\111\110",function(o,f,Z)if f==Enum.UserInputState.Begin then local H=1 else v7=0 end H.rightValue=v7 H:UpdateMovement(f)end,false,Enum.PlayerActions.CharacterRight)m:BindAction("\106\117\109\112\065\099\116\105\111\110",function(o,f,Z)H.isJumping=f==Enum.UserInputState.Begin end,false,Enum.PlayerActions.CharacterJump)end function o.UnbindContextActions(H)m:UnbindAction("\109\111\118\101\070\111\114\119\097\114\100\065\099\116\105\111\110")m:UnbindAction("\109\111\118\101\066\097\099\107\119\097\114\100\065\099\116\105\111\110")m:UnbindAction("\109\111\118\101\076\101\102\116\065\099\116\105\111\110")m:UnbindAction("\109\111\118\101\082\105\103\104\116\065\099\116\105\111\110")m:UnbindAction("\106\117\109\112\065\099\116\105\111\110")end function o.ConnectFocusEventListeners(H)local function o()H.moveVector=Z H.forwardValue=0 H.backwardValue=0 H.leftValue=0 H.rightValue=0 H.isJumping=false end H.textFocusReleasedConn=f.TextBoxFocusReleased:Connect(o)H.textFocusGainedConn=f.TextBoxFocused:Connect(function(o)H.isJumping=false end)H.windowFocusReleasedConn=f.WindowFocused:Connect(o)end function o.DisconnectFocusEventListeners(H)if H.textFocusReleasedCon then H.textFocusReleasedCon:Disconnect()H.textFocusReleasedCon=nil end if H.textFocusGainedConn then H.textFocusGainedConn:Disconnect()H.textFocusGainedConn=nil end if H.windowFocusReleasedConn then H.windowFocusReleasedConn:Disconnect()H.windowFocusReleasedConn=nil end end return o
-- Decompiled with the Synapse X Luau decompiler.

local v1 = require(script.Parent:WaitForChild("BaseCharacterController"))
local v2 = setmetatable({}, v1)
v2.__index = v2
function v2.new()
	local v3 = setmetatable(v1.new(), v2)
	v3.textFocusReleasedConn = nil
	v3.textFocusGainedConn = nil
	v3.windowFocusReleasedConn = nil
	v3.forwardValue = 0
	v3.backwardValue = 0
	v3.leftValue = 0
	v3.rightValue = 0
	return v3
end
local l__UserInputService__1 = game:GetService("UserInputService")
local u2 = Vector3.new(0, 0, 0)
function v2.Enable(p1, p2)
	if not l__UserInputService__1.KeyboardEnabled then
		return false
	end
	if p2 == p1.enabled then
		return true
	end
	p1.forwardValue = 0
	p1.backwardValue = 0
	p1.leftValue = 0
	p1.rightValue = 0
	p1.moveVector = u2
	p1.isJumping = false
	if p2 then
		p1:BindContextActions()
		p1:ConnectFocusEventListeners()
	else
		p1:UnbindContextActions()
		p1:DisconnectFocusEventListeners()
	end
	p1.enabled = p2
	return true
end
function v2.UpdateMovement(p3, p4)
	if p4 == Enum.UserInputState.Cancel then
		p3.moveVector = u2
		return
	end
	p3.moveVector = Vector3.new(p3.leftValue + p3.rightValue, 0, p3.forwardValue + p3.backwardValue)
end
local l__ContextActionService__3 = game:GetService("ContextActionService")
function v2.BindContextActions(p5)
	l__ContextActionService__3:BindAction("moveForwardAction", function(p6, p7, p8)
		if p7 == Enum.UserInputState.Begin then
			local v4 = -1
		else
			v4 = 0
		end
		p5.forwardValue = v4
		p5:UpdateMovement(p7)
	end, false, Enum.PlayerActions.CharacterForward)
	l__ContextActionService__3:BindAction("moveBackwardAction", function(p9, p10, p11)
		if p10 == Enum.UserInputState.Begin then
			local v5 = 1
		else
			v5 = 0
		end
		p5.backwardValue = v5
		p5:UpdateMovement(p10)
	end, false, Enum.PlayerActions.CharacterBackward)
	l__ContextActionService__3:BindAction("moveLeftAction", function(p12, p13, p14)
		if p13 == Enum.UserInputState.Begin then
			local v6 = -1
		else
			v6 = 0
		end
		p5.leftValue = v6
		p5:UpdateMovement(p13)
	end, false, Enum.PlayerActions.CharacterLeft)
	l__ContextActionService__3:BindAction("moveRightAction", function(p15, p16, p17)
		if p16 == Enum.UserInputState.Begin then
			local v7 = 1
		else
			v7 = 0
		end
		p5.rightValue = v7
		p5:UpdateMovement(p16)
	end, false, Enum.PlayerActions.CharacterRight)
	l__ContextActionService__3:BindAction("jumpAction", function(p18, p19, p20)
		p5.isJumping = p19 == Enum.UserInputState.Begin
	end, false, Enum.PlayerActions.CharacterJump)
end
function v2.UnbindContextActions(p21)
	l__ContextActionService__3:UnbindAction("moveForwardAction")
	l__ContextActionService__3:UnbindAction("moveBackwardAction")
	l__ContextActionService__3:UnbindAction("moveLeftAction")
	l__ContextActionService__3:UnbindAction("moveRightAction")
	l__ContextActionService__3:UnbindAction("jumpAction")
end
function v2.ConnectFocusEventListeners(p22)
	local function v8()
		p22.moveVector = u2
		p22.forwardValue = 0
		p22.backwardValue = 0
		p22.leftValue = 0
		p22.rightValue = 0
		p22.isJumping = false
	end
	p22.textFocusReleasedConn = l__UserInputService__1.TextBoxFocusReleased:Connect(v8)
	p22.textFocusGainedConn = l__UserInputService__1.TextBoxFocused:Connect(function(p23)
		p22.isJumping = false
	end)
	p22.windowFocusReleasedConn = l__UserInputService__1.WindowFocused:Connect(v8)
end
function v2.DisconnectFocusEventListeners(p24)
	if p24.textFocusReleasedCon then
		p24.textFocusReleasedCon:Disconnect()
		p24.textFocusReleasedCon = nil
	end
	if p24.textFocusGainedConn then
		p24.textFocusGainedConn:Disconnect()
		p24.textFocusGainedConn = nil
	end
	if p24.windowFocusReleasedConn then
		p24.windowFocusReleasedConn:Disconnect()
		p24.windowFocusReleasedConn = nil
	end
end
return v2
