Space bar input not recognized
I am having issues with getting any input functions to recognize input from the space bar. I used something like this initially:
void Update()
{
// Spacebar isn't getting picked up by getButtonDown?
if (Input.GetButtonDown("Jump")) {
Debug.Log("jumped");
shouldJump = true;
} else {
shouldJump = false;
}
}
The project is setup to have space as a jump button. I added the 'e' key as well, which works. So the issue doesn't seem to be related to logic. So it is not an issue with the 'Jump' input request.
Next I tried just getting the space button itself:
void Update()
{
// Spacebar isn't getting picked up by getButtonDown?
if (Input.GetKey(KeyCode.Space)) {
Debug.Log("jumped");
shouldJump = true;
} else {
shouldJump = false;
}
}
This also didn't work. So, after that I just set it that any button will print to the debug console:
void Update()
{
if (Input.anyKey) {
Debug.Log("Pressed ");
}
}
This one actually does print when the space bar is pressed. So I know space is working, I'm just not sure why the other functions aren't recognizing it as a valid input.
I am on Ubuntu 18.04 using 2019.4.5 LTS.
I have the same problem. Pressing the space bar shows the letter O. I am using Unity 2019.4.8 on Ubuntu 20.04. I didn't have this issue in Unity 2019.4.2
Answer by ghost7742 · Aug 24, 2020 at 10:59 AM
@tyler_bobik Actually, this error is only in 2019.4 LTS versions , Later on, 2020.1 has no issues with the spacebar input. Try this on your system by creating a new project in unity 2020.1. Do let me know...
Unity 2020.1.3f1 @ $$anonymous$$anjaro 20.1 Bug still persists.
Answer by Nazdorovye · Sep 01, 2020 at 06:55 AM
Here is another forum thread on this bug. Seems like defined virtual key codes for linux are corrupt.