IsControlPressed stuck when activating NUI

setTick(() => {
  if (IsControlJustReleased(0, 0x171910DC) && IsControlPressed(0, 0x8FFC75D6)) {
    // activate some nui script
  }
});

Here is an example of when releasing the TAB button and holding SHIFT, then proceeding to activate an NUI window, will get the SHIFT button stuck in the “pressed” state, until SHIFT is pressed again, AFTER the NUI window is no longer active.

Essentially, until you press SHIFT again, and release it, SHIFT will always be “pressed”.

It’s because you are capturing the keyboard or mouse in NUI. The game never receives the release of the key because NUI has captured. You will need to wait for the release of any control prior to capturing it by NUI.