- Home /
When pressing the space bar, the Unity editor detects it as the "O" key, how can I solve this?
Hello, I am having problems with detecting my keyboard keys within unity, I use Ubuntu 20.04 and the editor version is: 2019.4.4f1. The thing is that the Axis Jump was not detecting that I have it configured by default with the space bar, but when updating the version I stop taking the action, when I am checking and change the axis to "O" and press the space bar take, and when using the following script in the console when I press the space bar the letter "O" is also reflected:
foreach(KeyCode vKey in System.Enum.GetValues(typeof(KeyCode))){ if(Input.GetKey(vKey)){ Debug.Log(vKey);
} }
do you know what might be happening?
I had the same issue, I reported it as a bug but haven't had a reply yet, this was ~5 days ago. There was a warning that things are slow due to the pandemic and I also expect it will be low priority since it is the 'old' input system. Fortunately I tested the new Input System and that works correctly for spacebar button, though in the meantime I just swapped space for LeftControl to avoid changing everything if it is fixed swiftly.
They got back to me with the issue that had been raised https://issuetracker.unity3d.com/issues/linux-editor-returns-the-o-keys-keycode-when-the-space-key-is-being-pressed You can vote for it which should help it get dealt with faster!
Answer by dorusoftware · Jul 24, 2020 at 08:55 PM
In Project Settings check the Input Manager mappings maybe there is some wrong there. Some store assets may change the mapping without informing
Answer by Fehr · Oct 30, 2020 at 07:25 AM
It's not just the spacebar, the whole keyboard's remapped incorrectly. Add this to your scene and have a look:
public class InputTester : MonoBehaviour
{
private string _pressedKeys = string.Empty;
public void OnGUI() => GUILayout.Label(_pressedKeys);
void Update()
{
var pressedKeys = new List<KeyCode>();
foreach (KeyCode vKey in Enum.GetValues(typeof(KeyCode))) {
if (Input.GetKey(vKey)) {
pressedKeys.Add(vKey);
}
}
_pressedKeys = string.Concat(pressedKeys);
}
}
Has anyone been able to find a fix for this?
Your answer
Follow this Question
Related Questions
How to run DOTween tweens in succession? 0 Answers
No Monobehaviour scripts in files 1 Answer
Windows command prompt is not working when the Project is built 0 Answers
Unity Editors crashes after using a button in scene 2 Answers
What does "UnityEditor.ProjectBrowser:DeletedSelectedAssets(Boolean)" mean? 0 Answers