Can I get standard Input.inputString repeat style when arrow keys are held down?

If I use Input.inputString and hold down say the letter “a”, it will automatically return “a” the frame I press it, wait for a bit, then start rapid-firing, as it would in any standard text input field. How can I get this behavior for non-ascii / non “\b” and “\r” characters like arrow keys?

Obviously if I use Input.GetKey (KeyCode.Right), it will always return true as long as the right arrow key is held down, and Input.GetKeyDown (KeyCodeRight) will only return true the frame I press the right arrow. Neither of these are what I want for this case, and I really don’t want to program in my own workaround if I can avoid it… Any suggestions?

I’m not sure if there is something built into Unity that handles that automatically. Unfortunately Unity still expects you to put these in Update functions and check every frame, instead of making an event of them. So I think you may need to implement your own. Though I’d imagine it’s pretty simple (this is minus polymorphism):

public class TestInput : MonoBehaviour {

    [SerializeField] private float btnRepeatThreshold = 0.5f;
    private float currentElapsedTime;
    private bool btnDown = false;
 
    // Here to make sure it's not missed in fixed update
    void Update () {

        if (Input.GetKeyDown(KeyCode.A))
        {
            ButtonAction();
            btnDown = true;
        }

        if (Input.GetKeyUp(KeyCode.A))
        {
            btnDown = false;
        }
    }
    // Here to make sure it's a fixed time frame.
    private void FixedUpdate()
    {
        if (btnDown)
        {
            currentElapsedTime += Time.deltaTime;
        }

        if(currentElapsedTime >= btnRepeatThreshold)
        {
            ButtonAction();
        }
    }

    private void ButtonAction()
    {
        // Some stuff
    }
}

Yeah, I suppose that’ll work at least for now. Thanks!