Hotkey only in a specific window

7,097

Assuming that you know how to create a hotket that does the mouseclick, you would need to check the title of the Bluestack window with AHK Windows Spy then place the Enter hotkey here....

#SingleInstance Force
#installKeybdHook
#Persistent
SetTitleMatchMode, 2

#IfWinActive, BlueStack
Enter:: ; Your Hotkey inside Bluestack
    MouseClick, 123, 456
Return
#IfWinActive ; End the Bluestatck specific hotkeys...

A better way would be to see if AHK Windows Spy provides an object ID for the arrow (hover your mouse over the arrow when using AHK Windows Spy) and use ControlClick. You could even use ControlClick without activating the Bluestack application window (but that means using a specific hotkey, since the #IfWinActive, Bluestack would not work)

Share:
7,097
user2342670
Author by

user2342670

Updated on September 18, 2022

Comments

  • user2342670
    user2342670 over 1 year

    I want to configure the ENTER key so that when I press it (but only in a certain program - Bluestack app player), the mouse moves to a certain position and makes a click.

    This is because when I press ENTER, WhatsApp makes an end of line, but I want text to be sent. So the mouse would need to be positioned on the arrow.

    Is it about the window title? Or the process? If the latter, which process do I check for, out of all those that appear in task manager?

    Here's a picture, for more clarity:

    1

  • Robert Ilbrink
    Robert Ilbrink almost 11 years
    It looks at the window title, but I see that it is BlueStack and since this is case sensitive, so Bluestack will NOT match, you need to use BlueStack
  • user2342670
    user2342670 almost 11 years
    thank you very much. I tried Windows Spy, and a its very nice tool. Still, code you wrote helped me to understand. 5 stars!!