Few questions about RegisterKeyMapping

So actually i have 2 questions.

  1. Can keybinds created with the RegisterKeyMapping method be disabled for a temporary amount of time? For example, when my player starts using some NUI element, it would be disabled for the time of the NUI being active, so the player cannot activeate anything the player doesn’t want, while typing.

  2. Is it possible to register when these keybinds are held down. I did some searching but couldn’t find anything about holding down the button. I imagine it would be done by using something like those we use with the original keybinds (IsControlPressed, IsControlJustReleased, IsControlJustPressed).

If someone could help with these questins, I would highly appriciate it.

Thank you!

yeah, just handle such in the command you use on binding

yeah, just handle such in the command you use on binding as long as it’s prefixed with + (so it triggers - variant of it when released) like in the example

My problem is, that the dependency of the command being disabled is not in the same resource as the command. So as with the example, the command I am binding to is in resource1, but the phone is a completly different resource, like phone1.
Your answer could worik tough, if there is a way to declare global variables, wich i can acces and modify in any resource.

So if i understand it correctly, when i bind the command +command, i can create an other command wich i call -command, then +command is executed when i press down the button, and -command when i release it?

correct.

add some sort of suppression export probably