[Help] Custom Key Bindings (Controller)

Hey
Wanna separate controls for keyboard users and for controller users

to do that i put a single key for keyboard, and a key combination for controller

I used this structure until now :

    if IsControlPressed(1, KBKEY) then
        OpenMenu()
    elseif IsControlPressed(1, XBOXKEY1) and not blockinput then
        if IsControlJustReleased(1, XBOXKEY2) then
            OpenMenu()
        end
    end

for optimization purposes when the “OpenMenu()” is more than one line, i’d like to use something single line like :

if (IsControlJustPressed(1, KB1)) or ((IsControlJustPressed(1, XB1) and IsControlJustPressed (1, XB2)) then

    OpenMenu()

end

Can someone help me with that?

You can use this native to differentiate gamepad input and keyboard input : https://runtime.fivem.net/doc/natives/#_0xA571D46727E2B718