Check out example codes for "how to see if they are aholding down a key unity". It will help you in understanding the concepts better.

Code Example 1

input.GetKey("Key")

Learn ReactJs, React Native from akashmittal.com