[HOWTO] How To: Address Alt+Tab Bug w/Input System Package

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22119
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Address Alt+Tab Bug w/Input System Package

Post by Tony Li »

This FAQ regards a general Unity / Input System bug, not specific to the Dialogue System.

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);
}
(Contributed by Bontemps Games. Wishlist While The Iron's Hot.)
Post Reply