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?