Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Input.inputstring "F" key missing

Discussion in 'Editor & General Support' started by Plummers, May 28, 2020.

  1. Plummers

    Plummers

    Joined:
    Oct 29, 2015
    Posts:
    35
    So every key works fine and reports correctly except for F. When I press F the debug reports blank, for every other key it reports their letter.

    Code (CSharp):
    1. void Update()
    2.     {
    3.         if (Input.anyKeyDown)
    4.         {
    5.             Debug.Log(Input.inputString);
    6.         }
    7.     }
    Using Unity 2019.3.14f, the bug occurs in my game project and in a new blank project. Seems very random!
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    So this might sound weird but... try a different keyboard. I have an issue with one of my keyboards where I can type the number '8', but if I try to use it in Unity or in a key tester like https://unixpapa.com/js/testkey.html it actually only gives a KeyUp event and not the KeyDown :O.
     
    Plummers likes this.
  3. Plummers

    Plummers

    Joined:
    Oct 29, 2015
    Posts:
    35
    Thanks for suggesting that but it works fine on that key tester website and I've just tested this again on a new computer, new keyboard, new project, older version of Unity = same bug happens.
     
  4. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Ah, oh well. Was worth a shot. The other thing I can think of is maybe the editor itself is capturing the input? Does the bug happen if you make a build? It might only be in the editor.
     
    Joe-Censored likes this.
  5. Plummers

    Plummers

    Joined:
    Oct 29, 2015
    Posts:
    35
    Ha yep you're right. Works fine in a build so must be an Editor thing. Still seems like a bug that should be fixed though.
     
    Joe-Censored likes this.
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I wasn't aware of it, but it appears that "F" by itself is a default Unity hotkey. Probably related I would assume.

    https://docs.unity3d.com/2017.3/Documentation/Manual/UnityHotkeys.html

    If you're running a newer version of Unity you could see if it is one of the hotkeys which can be remapped. I think the shortcut manager was added around 2019.1.

    https://docs.unity3d.com/Manual/UnityHotkeys.html

    (Yes I just linked two different versions of the same manual page, since for some reason they contain completely different information)
     
    Plummers likes this.