function BaseCamera.OnKeyDown(R,t,a)if not R.hasGameLoaded and VRService.VREnabled then return end if a then return end if R.distanceChangeEnabled then if t.KeyCode==Enum.KeyCode.I then R:SetCameraToSubjectDistance(R.currentSubjectDistance-5)elseif t.KeyCode==Enum.KeyCode.O then R:SetCameraToSubjectDistance(R.currentSubjectDistance+5)end end if R.panBeginLook==nil and R.keyPanEnabled then if t.KeyCode==Enum.KeyCode.Left then R.turningLeft=true elseif t.KeyCode==Enum.KeyCode.Right then R.turningRight=true elseif t.KeyCode==Enum.KeyCode.Comma then local t=Util.RotateVectorByAngleAndRound(R:GetCameraLookVector()*Vector3.new(1,0,1),-math.pi*.1875,math.pi*.25)if t~=0 then R.rotateInput=R.rotateInput+Vector2.new(t,0)R.lastUserPanCamera=tick()R.lastCameraTransform=nil end elseif t.KeyCode==Enum.KeyCode.Period then local t=Util.RotateVectorByAngleAndRound(R:GetCameraLookVector()*Vector3.new(1,0,1),math.pi*.1875,math.pi*.25)if t~=0 then R.rotateInput=R.rotateInput+Vector2.new(t,0)R.lastUserPanCamera=tick()R.lastCameraTransform=nil end elseif t.KeyCode==Enum.KeyCode.PageUp then R.rotateInput=R.rotateInput+Vector2.new(0,math.rad(15))R.lastCameraTransform=nil elseif t.KeyCode==Enum.KeyCode.PageDown then R.rotateInput=R.rotateInput+Vector2.new(0,math.rad(-15))R.lastCameraTransform=nil end end end

function BaseCamera:OnKeyDown(input, processed)
	if not self.hasGameLoaded and VRService.VREnabled then
		return
	end

	if processed then
		return
	end

	if self.distanceChangeEnabled then
		if input.KeyCode == Enum.KeyCode.I then
			self:SetCameraToSubjectDistance( self.currentSubjectDistance - 5 )
		elseif input.KeyCode == Enum.KeyCode.O then
			self:SetCameraToSubjectDistance( self.currentSubjectDistance + 5 )
		end
	end

	if self.panBeginLook == nil and self.keyPanEnabled then
		if input.KeyCode == Enum.KeyCode.Left then
			self.turningLeft = true
		elseif input.KeyCode == Enum.KeyCode.Right then
			self.turningRight = true
		elseif input.KeyCode == Enum.KeyCode.Comma then
			local angle = Util.RotateVectorByAngleAndRound(self:GetCameraLookVector() * Vector3.new(1,0,1), -math.pi*0.1875, math.pi*0.25)
			if angle ~= 0 then
				self.rotateInput = self.rotateInput + Vector2.new(angle, 0)
				self.lastUserPanCamera = tick()
				self.lastCameraTransform = nil
			end
		elseif input.KeyCode == Enum.KeyCode.Period then
			local angle = Util.RotateVectorByAngleAndRound(self:GetCameraLookVector() * Vector3.new(1,0,1), math.pi*0.1875, math.pi*0.25)
			if angle ~= 0 then
				self.rotateInput = self.rotateInput + Vector2.new(angle, 0)
				self.lastUserPanCamera = tick()
				self.lastCameraTransform = nil
			end
		elseif input.KeyCode == Enum.KeyCode.PageUp then
			self.rotateInput = self.rotateInput + Vector2.new(0,math.rad(15))
			self.lastCameraTransform = nil
		elseif input.KeyCode == Enum.KeyCode.PageDown then
			self.rotateInput = self.rotateInput + Vector2.new(0,math.rad(-15))
			self.lastCameraTransform = nil
		end
	end
end
