So what you want to happen is that when the mouse is at some screen coordinates (no matter how the mouse pointer got to those coordinates) you want to press the "W" key on the keyboard and execute an action that appears to the app or game as if there was a mouse click.
Correct?
So the required/desired emulation software, running in the background would be waiting for some keystroke, intercept that keystroke, and would instead simulate another action or event such as a mouse click.
Any such software will require you to do some configuration beforehand. What event to listen for and what event to execute once heard.
Likely doable in Python.
Should not take much of script to write a loop that "listens for" a "W" key press...