Hotkey only in a specific window

1

I want configure the key ENTER so when I press it only in a program (Bluestack app player), the mouse move at a certain position and make click. This is because when I press ENTER, in WHATSAP, makes and end of line, and I want text to be sent (I don't know, if someone knows the way for change that in Bluestacks would be okay) but still I want to learn to do this. So the mouse would be positioned on the arrow.

It's about the window title? Or the process? If the last, which one of all appears in task manager?

Here's a picture, for more clarity:

1

user2342670

Posted 2013-05-02T10:33:21.010

Reputation: 13

Answers

4

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)

Robert Ilbrink

Posted 2013-05-02T10:33:21.010

Reputation: 1 509

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 – Robert Ilbrink – 2013-05-03T15:00:07.390

thank you very much. I tried Windows Spy, and a its very nice tool. Still, code you wrote helped me to understand. 5 stars!! – user2342670 – 2013-05-05T17:55:59.657