Get mouse click or keyboard while lose foucs in standalone

Making a clicking game

want to count some clicks while user doing other jobs(lose foucs on application)

not required to know which key is clicking(just want the amount of clicks)

But it seems only mouse position is still available during lose focus

is there any way to do that?

As far as I know this is OS specific and Unity does not have native support for this functionality.

Many people recommended to check out this GitHub project