untiy listen for key press code example
Example: unity key detection
if (Input.GetKeyDown(KeyCode.Space))
{
print("space key was pressed");
}
if (Input.GetKeyDown(KeyCode.Space))
{
print("space key was pressed");
}