local function U(U)U.textBox.FocusLost:connect(function(A)if U.mainParent.Name~="\067\109\100\066\097\114"or U.specificArg then if U.suggestionDisplayed>0 then selectSuggestion(U,U.specificArg)end else if U.suggestionDisplayed>0 and(not forceExecute and main.device~="\077\111\098\105\108\101")then selectSuggestion(U)elseif A then if forceExecute then selectSuggestion(U)end module:CloseCmdBar()if#U.textBox.Text>1 then local A=U.textBox.Text local o=string.sub(A,1,1)if o~=main.settings.UniversalPrefix and o~=main.pdata.Prefix then A=main.pdata.Prefix..A end local K=string.sub(A,-1)if K==" "then A=string.sub(A,1,-1)end main.signals.RequestCommand:InvokeServer(A)end end end end)end
--Hide cmdbar and request command when FocusLost
local function setupEnterPress(props)
	props.textBox.FocusLost:connect(function(enter)
		if props.mainParent.Name ~= "CmdBar" or props.specificArg then
			if props.suggestionDisplayed > 0 then
				selectSuggestion(props, props.specificArg)
			end
		else
			if props.suggestionDisplayed > 0 and not forceExecute and main.device ~= "Mobile" then
				selectSuggestion(props)
			elseif enter then
				if forceExecute then
					selectSuggestion(props)
					--wait()
				end
				module:CloseCmdBar()
				if #props.textBox.Text > 1 then
					local commandToRequest = props.textBox.Text
					local firstChar = string.sub(commandToRequest, 1, 1)
					if firstChar ~= main.settings.UniversalPrefix and firstChar ~= main.pdata.Prefix then
						commandToRequest = main.pdata.Prefix .. commandToRequest
					end
					local endChar = string.sub(commandToRequest, -1)
					if endChar == " " then
						commandToRequest = string.sub(commandToRequest, 1, -1)
					end
					main.signals.RequestCommand:InvokeServer(commandToRequest)
				end
			end
		end
	end)
end
