fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(mumble): resolve push-to-talk not working inside menu/map

Open Ktos93 opened this issue 3 years ago • 7 comments

usage IS_DISABLED_CONTROL_PRESSED fix problem when we cant talk with open menu/map but still we can disable this control by DISABLE_ALL_CONTROL_ACTIONS etc.

Ktos93 avatar Jan 20 '22 17:01 Ktos93

We need this change to be 100% functional

ghostrecom avatar Apr 05 '22 13:04 ghostrecom

Yes! this is really important!

dkden7e avatar Apr 05 '22 13:04 dkden7e

Sadly this solution is very rough and have very annoying side effects. For example, if you press N (default push-to-talk control) and keep talking, while trying to open in-game chat (or do anything that would block the controls in general, open map, alt-tab and etc), the state of pressed N would be frozen until you press it again. So player would keep talking even when he doesn't want to. That's why FiveM have a bit more complex realization of such a feature. I would prefer to avoid such annoying "side effect", for me the benefits of this PR aren't comparable to the problems that this solution makes.

Disquse avatar Apr 05 '22 14:04 Disquse

Hopefully in the future it will have a better solution

ghostrecom avatar Apr 05 '22 15:04 ghostrecom

If I'm not mistaken the problems you write about already occur in the game. Running any NUI overlay causes the pressed state of N to be frozen until pressed again. Same if you pressing N and open console. So you need to add something like this to your scripts

 SetNuiFocus(true, true)
 SetNuiFocusKeepInput(true)
 DisableControlsKey()

function DisableControlsKey()
    Citizen.CreateThread(function()
        while isInventoryOpen do
            Wait(0)
            DisableAllControlActions(0)
            EnableControlAction(0, 0x4BC9DABB, true) -- INPUT_PUSH_TO_TALK
        end
    end)
end

https://streamable.com/qxo8fw left bottom corner microphone icon

Ktos93 avatar Apr 07 '22 14:04 Ktos93

Would it not make sense to just use IsDisabledControlPressed for GTA and RDR?

This would fix an issue for pma-voice where you can't use radio (or simulate PTT) while in the map because every control action gets disabled

AvarianKnight avatar Apr 09 '22 23:04 AvarianKnight

@Disquse What do you think about it?

Ktos93 avatar Apr 19 '22 13:04 Ktos93