(Help) Disable some key while textinput

So I have a new problem . When I write my sms to someone it activates some keys that trigger things . For example M is opening vehicle control .

Would it be possible to Disable those function to stop but still being to type the letter in my sms ?

Here is my current function :

function OpenTextInput()
DisplayOnscreenKeyboard(1, “FMMC_KEY_TIP8”, “”, “”, “”, “”, “”, 64)
while (UpdateOnscreenKeyboard() == 0) do
DisableAllControlActions(0);
Wait(0);
end
if (GetOnscreenKeyboardResult()) then
local result = GetOnscreenKeyboardResult()
return result
end
end

Thanks guys

add this to you code:

blockinput

Citizen.CreateThread(function()
	local count
	while true do

		if blockinput then
			count = 1
			DisableAllControlActions(0)
			DisableAllControlActions(1)
			DisableAllControlActions(2)
			DisableAllControlActions(3)
			DisableAllControlActions(4)
			DisableAllControlActions(5)
			DisableAllControlActions(6)
			DisableAllControlActions(7)
			DisableAllControlActions(8)
			DisableAllControlActions(9)
			DisableAllControlActions(10)
			DisableAllControlActions(11)
			DisableAllControlActions(12)
			DisableAllControlActions(13)
			DisableAllControlActions(14)
			DisableAllControlActions(15)
			DisableAllControlActions(16)
			DisableAllControlActions(17)
			DisableAllControlActions(18)
			DisableAllControlActions(19)
			DisableAllControlActions(20)
			DisableAllControlActions(21)
			DisableAllControlActions(22)
			DisableAllControlActions(23)
			DisableAllControlActions(24)
			DisableAllControlActions(25)
			DisableAllControlActions(26)
			DisableAllControlActions(27)
			DisableAllControlActions(28)
			DisableAllControlActions(29)
			DisableAllControlActions(30)
			DisableAllControlActions(31)
		elseif not blockinput and count == 1 then
			count = 0
			EnableAllControlActions(0)
			EnableAllControlActions(1)
			EnableAllControlActions(2)
			EnableAllControlActions(3)
			EnableAllControlActions(4)
			EnableAllControlActions(5)
			EnableAllControlActions(6)
			EnableAllControlActions(7)
			EnableAllControlActions(8)
			EnableAllControlActions(9)
			EnableAllControlActions(10)
			EnableAllControlActions(11)
			EnableAllControlActions(12)
			EnableAllControlActions(13)
			EnableAllControlActions(14)
			EnableAllControlActions(15)
			EnableAllControlActions(16)
			EnableAllControlActions(17)
			EnableAllControlActions(18)
			EnableAllControlActions(19)
			EnableAllControlActions(20)
			EnableAllControlActions(21)
			EnableAllControlActions(22)
			EnableAllControlActions(23)
			EnableAllControlActions(24)
			EnableAllControlActions(25)
			EnableAllControlActions(26)
			EnableAllControlActions(27)
			EnableAllControlActions(28)
			EnableAllControlActions(29)
			EnableAllControlActions(30)
			EnableAllControlActions(31)
		end

		Citizen.Wait(0)
	end
end)

and if you are using the keyboard input, just set blockinput to true and at the end to false again, like this:

function OpenTextInput()
	DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP8", "", "", "", "", "", 64)
	while (UpdateOnscreenKeyboard() == 0) do
		blockinput = true
		Wait(0);
	end
	if (GetOnscreenKeyboardResult()) then
		local result = GetOnscreenKeyboardResult()
		blockinput = false
		return result
	end
end

I didn’t tested it, but this should work

Welp nope it doesnt stop anything . It works exactly like my old script . Vehicle menu still opens when I press M.