Help Mouse with HTML UI

Hey guys i need help In my identity script, So until the last fiveMM update everything works perfectly. But with the latest update September 2nd, 2017

Another update has been released to the FiveM :mascot: production channel. This one is dubbed โ€œ:honey_pot:โ€.

Summarized changelog
Allow loading screens to be loaded from http:// instead of files in a resource. :tv:
Disable the GTA loading music. :mute:
Allow keyboard input during loading. :keyboard:
Add status indicators during resource download. :bar_chart:
Fix the โ€˜closeโ€™ button in the โ€˜Couldnโ€™t load resource :(โ€™ error. :x:
Minor tweaks to the GTA/RAGE script engine. :t_rex:

My mouse cursor on the UI stopped working. The mouse continues to interact with the background game even though I blocking left, right, up, down. I will leave part of my script where I believe the problem is, can anyone help? Iโ€™m really desperate.

local KeyToucheClose = 177 -- PhoneCancel
local distMaxCheck = 3
local menuIsOpen = 0
 
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
    if menuIsOpen ~= 0 then
      if IsControlJustPressed(1, KeyToucheClose) and menuIsOpen == 1 then
        closeGui()
      elseif menuIsOpen == 2 then
        local ply = GetPlayerPed(-1)
        DisableControlAction(0, 1, true)
        DisableControlAction(0, 2, true)
        DisableControlAction(0, 24, true)
        DisablePlayerFiring(ply, true)
        DisableControlAction(0, 142, true)
        DisableControlAction(0, 106, true)
        DisableControlAction(0,KeyToucheClose,true)
        if IsDisabledControlJustReleased(0, 142) then
          SendNUIMessage({method = "clickGui"})
        end
      end
    end
  end
end)
1 Like

same probleme for me with the last update 2017/09/02

This should be fixed now.

1 Like

thx its realy nice :slight_smile: fast support +1

1 Like

Iยดm having a similar problem with a nui register window, is not detecting left mouse click, here is the code:

Citizen.CreateThread(function()
	while true do
		if guiEnabled then
			DisableControlAction(0, 1,   true) -- LookLeftRight
			DisableControlAction(0, 2,   true) -- LookUpDown
			DisableControlAction(0, 18, true) -- Enter
			DisableControlAction(0, 21,  true) -- disable sprint
			DisableControlAction(0, 24,  true) -- disable attack
			DisableControlAction(0, 25,  true) -- disable aim
			DisableControlAction(0, 30,  true) -- MoveLeftRight
			DisableControlAction(0, 31,  true) -- MoveUpDown
			DisableControlAction(0, 47,  true) -- disable weapon
			DisableControlAction(0, 58,  true) -- disable weapon
			DisableControlAction(0, 75,  true) -- disable exit vehicle
			DisableControlAction(27, 75, true) -- disable exit vehicle
			DisableControlAction(0, 92,  true) -- 
			DisableControlAction(0, 106, true) -- VehicleMouseControlOverride
			DisableControlAction(0, 140, true) -- disable melee
			DisableControlAction(0, 141, true) -- disable melee
			DisableControlAction(0, 142, true)
			DisableControlAction(0, 143, true) -- disable melee
			DisableControlAction(0, 223, true) --
			DisableControlAction(0, 263, true) -- disable melee
			DisableControlAction(0, 264, true) -- disable melee
			DisableControlAction(0, 257, true) -- disable melee
            DisableControlAction(0, 322, true) -- ESC            
			
			Citizen.Trace("ESX_IDENTITY - ENTERED")
			
			if IsDisabledControlPressed(0, 142) then -- leftmouseclick				
				Citizen.Trace("ESX_IDENTITY - CLICKED")
                SendNUIMessage({
                    type = "click"
                })
            end
			
		end
		Citizen.Wait(0)
	end
end)