assert((game:GetService("\082\117\110\083\101\114\118\105\099\101")):IsClient(),"\075\101\121\098\111\097\114\100 \099\097\110 \111\110\108\121 \098\101 \117\115\101\100 \102\114\111\109 \099\108\105\101\110\116")local U={}local F=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local i={}local A=Enum.UserInputType.Keyboard local y=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")local d=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")U.KeyDown=y.Event U.KeyUp=d.Event function U.IsDown(F,U)return i[U]==true end local function r(U,F)if F then return end if U.UserInputType==A then local F=U.KeyCode i[F]=true y:Fire(F)end end local function S(U,F)if F then return end if U.UserInputType==A then local F=U.KeyCode i[F]=false d:Fire(F)end end F.InputBegan:Connect(r)F.InputEnded:Connect(S)return U



assert(game:GetService("RunService"):IsClient(), "Keyboard can only be used from client")


local Keyboard = {}

local userInput = game:GetService("UserInputService")

local isDown = {}

local keyboardInput = Enum.UserInputType.Keyboard

local onKeyDown  = Instance.new("BindableEvent")
local onKeyUp    = Instance.new("BindableEvent")

Keyboard.KeyDown  = onKeyDown.Event
Keyboard.KeyUp    = onKeyUp.Event


function Keyboard:IsDown(keyCode)
	return (isDown[keyCode] == true)
end


local function InputBegan(input, processed)
	if (processed) then return end
	if (input.UserInputType == keyboardInput) then
		local key = input.KeyCode
		isDown[key] = true
		onKeyDown:Fire(key)
	end
end

local function InputEnded(input, processed)
	if (processed) then return end
	if (input.UserInputType == keyboardInput) then
		local key = input.KeyCode
		isDown[key] = false
		onKeyUp:Fire(key)
	end
end


userInput.InputBegan:Connect(InputBegan)
userInput.InputEnded:Connect(InputEnded)


return Keyboard
