If you're using the Input System package and are facing this issue:
ALT-TABBING OUT OF BUILD LEAVES THE ALT KEY PRESSED ON RETURN
Add a script with this method to your game (e.g., on the Dialogue Manager):
Code: Select all
private void OnApplicationFocus(bool hasFocus)
{
// resetting to avoid the problem of alt-tabbing making altKey stuck.
InputSystem.ResetDevice(Keyboard.current);
}