local function s(s,P,m)local T={Primary=P,Secondary=m}actions[s]=T end local function P(s)for P,m in pairs(actions)do if m.Primary then if m.Primary.EnumType==Enum.KeyCode then if s.KeyCode==m.Primary then return P end elseif m.Primary.EnumType==Enum.UserInputType then if s.UserInputType==m.Primary then return P end end end if m.Secondary then if m.Secondary.EnumType==Enum.KeyCode then if s.KeyCode==m.Secondary then return P end elseif m.Secondary.EnumType==Enum.UserInputType then if s.UserInputType==m.Secondary then return P end end end end end
-- functions

local function RegisterAction(action, primary, secondary)
	local info = {
		Primary = primary,
		Secondary = secondary,
	}

	actions[action] = info
end

local function ActionFromInputObject(inputObject)
	for action, info in pairs(actions) do
		if info.Primary then
			if info.Primary.EnumType == Enum.KeyCode then
				if inputObject.KeyCode == info.Primary then
					return action
				end
			elseif info.Primary.EnumType == Enum.UserInputType then
				if inputObject.UserInputType == info.Primary then
					return action
				end
			end
		end

		if info.Secondary then
			if info.Secondary.EnumType == Enum.KeyCode then
				if inputObject.KeyCode == info.Secondary then
					return action
				end
			elseif info.Secondary.EnumType == Enum.UserInputType then
				if inputObject.UserInputType == info.Secondary then
					return action
				end
			end
		end
	end
end
