local y={}local u=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")function y.IsDown(l,y)return u:IsKeyDown(y)end function y.AreAllDown(y,...)for y,l in pairs({...})do if not u:IsKeyDown(l)then return false end end return true end function y.AreAnyDown(y,...)for y,l in pairs({...})do if u:IsKeyDown(l)then return true end end return false end function y.Start(y) end function y.Init(y)y.KeyDown=y.Shared.Signal.new()y.KeyUp=y.Shared.Signal.new()u.InputBegan:Connect(function(u,l)if l then return end if u.UserInputType==Enum.UserInputType.Keyboard then y.KeyDown:Fire(u.KeyCode)end end)u.InputEnded:Connect(function(u,l)if l then return end if u.UserInputType==Enum.UserInputType.Keyboard then y.KeyUp:Fire(u.KeyCode)end end)end return y
--[[
	
	Boolean   Keyboard:IsDown(keyCode)
	Boolean   Keyboard:AreAllDown(keyCodes...)
	Boolean   Keyboard:AreAnyDown(keyCodes...)
	
	Keyboard.KeyDown(keyCode)
	Keyboard.KeyUp(keyCode)
	
--]]

local Keyboard = {}

local userInput = game:GetService("UserInputService")

function Keyboard:IsDown(keyCode)
	return userInput:IsKeyDown(keyCode)
end

function Keyboard:AreAllDown(...)
	for _, keyCode in pairs({ ... }) do
		if not userInput:IsKeyDown(keyCode) then
			return false
		end
	end
	return true
end

function Keyboard:AreAnyDown(...)
	for _, keyCode in pairs({ ... }) do
		if userInput:IsKeyDown(keyCode) then
			return true
		end
	end
	return false
end

function Keyboard:Start() end

function Keyboard:Init()
	self.KeyDown = self.Shared.Signal.new()
	self.KeyUp = self.Shared.Signal.new()

	userInput.InputBegan:Connect(function(input, processed)
		if processed then
			return
		end
		if input.UserInputType == Enum.UserInputType.Keyboard then
			self.KeyDown:Fire(input.KeyCode)
		end
	end)

	userInput.InputEnded:Connect(function(input, processed)
		if processed then
			return
		end
		if input.UserInputType == Enum.UserInputType.Keyboard then
			self.KeyUp:Fire(input.KeyCode)
		end
	end)
end

return Keyboard
