Feedback on software window

I am trying to make a simple setup that sends keyboard shortcut when a button is pressed. The shortcut sent is dependent on the software window that the mouse is hovering over. E.g. if the mouse is over a google chrome window when the button is pressed it will send "alt+r", or if it is over microsoft word window, then it will send "ctrl+s".

The question is; Is there a way to get information on what window the mouse is hovering over?

Not to the Arduino. Best you could do would be to have a code running on the PC looking for the input from the Arduino and picking the right keystrokes in that code.