Don't focus the input field on startup

Issue #95 resolved
Ethan SK created an issue

Especially annoying on mobile where the keyboard will show when the game boots up / scene boots up with qc set to activate instantly. Could also be an issue if user has keyboard input to their game and tries to send input but it starts typing in QC instead even though they didn’t explicitly open qc with esc

Comments (7)

  1. Yusuf Ismail repo owner
    • changed status to open

    Currently the internal OverrideConsoleInput causes the input field to take focus: part of the reason is because Unity defocuses after entering a command so this is required to keep the input field focused

    Things will need to be refactored in some way so that QC still behaves as expected in all cases (even auto focus when showing the console via a hotkey) but so that there is more control over when to focus (and don't do it during startup)

  2. Yusuf Ismail repo owner

    Design Considerations

    OverrideConsoleInput can be modified in one of two ways

    1. Given an optional parameter shouldFocus
    2. Split into two functions, one that sets the input and one that does the focusing (but then all usages of the function need to ensure to call both)
    3. Combination of 1 and 2

    Activate then needs to either

    1. Optional parameter shouldFocus
    2. Have the focus grab remove, and have that handled by the caller of Activate

  3. Yusuf Ismail repo owner

    API’s have been improved, OverrideConsoleInput uses 3, and Activate uses 1

    The auto console open on log option now uses Activate(false) as to not steal user input focus when automatically opening

  4. Yusuf Ismail repo owner

    User Settings

    Need to strike the right balance of fine/coarse settings on when to auto focus

    e.g could be global, could be per interaction

  5. Yusuf Ismail repo owner

    Activate on startup only steals focus on Desktop platforms now, this issue may be re-opened if it is deemed that user configuration is still necessary

  6. Log in to comment