unity detect any key

C#
if (Input.anyKey) {
  // Code here
}
Source

Also in C#: