There are many resources on CP for using Global Hooks: whether any of them meet your exact need here, or can be adapted to your exact need: I don't know.
Be sure and read, re GlobalHooks in Win 7: "Change to Global Keyboard and Mouse Hooks behavior in Windows 7 by Dave Kreskowiak"[
^].
Suggest you start your research with the frequently revised "classic" article, "Processing Global Mouse and Keyboard Hooks in C# by George Mamaladze | 1 Sep 2011" [
^], and then search further on CP for "global hook."