Can GetKey work in OnMouseDown?

I attach this script to an object and add a collider.

Once I click the object and it will print “clicked”.
If I hold down the A key or any key for that matter it doesnt respond.

Can anyone test this code and tell me if it is just my system. Because I had something similar working before.

Thanks

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class buttonstuff : MonoBehaviour {

	// Use this for initialization
	void Start () {
		
	}
    void OnMouseDown()
    {
        print("clicked");
        if(Input.GetKey(KeyCode.A))
        {
            print("clicked A");
        }

    }


    // Update is called once per frame
    void Update () {
		
	}
}

Tested and the results were the same. But you can get it working by doing this.

private bool mouseClick = false;

void Start () {
    
}

void Update () {
    if (Input.GetKey(KeyCode.A) && mouseClick) {
        print("clicked A");
    }
}

void OnMouseDown() {
    print("clicked");
    mouseClick = true;
}

void OnMouseUp() {
    print("released");
    mouseClick = false;
}

I tried your code and I am getting the same result.
Running on a new project with only 1 game object and the script attached.

it prints clicked, release but gets stuck on clicked A.

Its as if holding down any key prevents OnMouseDown from working.

It seems to have started with the recent Windows 10 update.
Are you running the latest windows 10 update?

Thanks for the help