input.getkeydown in unity
using UnityEngine;
using System.Collecctions;
public class ExampleClass : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown("space")) //Instead of `space` place the key you want
print("It works!");
}
}