"Keys to send" problem

Here you are welcome to discuss items of general interest related to Push2Run
Post Reply
bigboss97
Posts: 9
Joined: Sun Feb 24, 2019 7:19 pm

"Keys to send" problem

Post by bigboss97 »

I tried "Keys to send" on Notepad and it works beautifully.
Then I tried it on my program which has a splash screen "Welcome". I sent an {ENTER} to the focused button and it didn't work.
My question... is the key sent to the process *.exe or the window with its title?
Another question, is this post still relevant?
https://www.push2run.com/phpbb/viewtopic.php?t=14
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: "Keys to send" problem

Post by RobLatour »

Assuming you don't specify 'Desktop' or 'Active Window' in the Push2Run's cards open field, Push2Run will send the keys to the first window that opens up. However, it will not be restricted to that window, allowing you to 'navigate' from window to window.

You may want to try put a brief wait in the keys to send sequence prior to having the enter sent.

I'm not sure how your programs splash screen works, most are used to distract the user a bit while the program loads and will self-close.

Re the link, those instructions told people how to send keys to an application prior to that feature being built into the program. They are still relevant in that you can still do it that way, but for most cases, the keys to send feature should be an easier way to approach it.
bigboss97
Posts: 9
Joined: Sun Feb 24, 2019 7:19 pm

Re: "Keys to send" problem

Post by bigboss97 »

I guess I know the problem.
My program is a little mess. In my memory, it used to start with a main window. But since I have introduced a lot of GUI stuff I hide the main window and display a small window at the beginning where user can decide how the program to be run, e.g. full screen or window etc.
In other words, the active window is not the main window. I guess Push2Run sends key strokes to the application window. I can put wait and the keys are still sent to the main window.
This is my guess :D

Can I launch an application and send keys to active window, instead using a 2nd card for active window?
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: "Keys to send" problem

Post by RobLatour »

ok - thanks for the update.

Yes, if you decide to launch another program to send keys to the active window, then you may want to look at Autohotkey to do this.
GordThompson
Posts: 18
Joined: Sun Feb 24, 2019 8:47 am

Re: "Keys to send" problem

Post by GordThompson »

RobLatour wrote: Sun Mar 03, 2019 7:29 am if you decide to launch another program to send keys to the active window, then you may want to look at Autohotkey to do this.
I can confirm that I use Push2Run in conjunction with AutoIt and it works well.

Tangential question: For the keys listed in the "Keys to send" section of the Push2Run help, do {ADD}, {SUBTRACT}, {MULTIPLY}, and {DIVIDE} refer to the numpad (numeric keypad) keys "+", "-", "*", and "/"?
bigboss97
Posts: 9
Joined: Sun Feb 24, 2019 7:19 pm

Re: "Keys to send" problem

Post by bigboss97 »

RobLatour wrote: Sun Mar 03, 2019 7:29 am Yes, if you decide to launch another program to send keys to the active window, then you may want to look at Autohotkey to do this.
Thanks for the tip. I have used AutoIt before. What's the main difference between AutoIt and AutoHotkey?

Is it possible to have an option in the card and allows sending keys to active windows only?
RobLatour
Site Admin
Posts: 1017
Joined: Mon Feb 19, 2018 11:43 am

Re: "Keys to send" problem

Post by RobLatour »

For a write up on the differences between AutoHotKey and Autoit please see here.

You can already send keys to the active window, just set the open field on the Push2Run card to "Active Window".
bigboss97
Posts: 9
Joined: Sun Feb 24, 2019 7:19 pm

Re: "Keys to send" problem

Post by bigboss97 »

RobLatour wrote: Sun Mar 03, 2019 8:27 pm For a write up on the differences between AutoHotKey and Autoit please see here.

You can already send keys to the active window, just set the open field on the Push2Run card to "Active Window".
OK, thanks. I guess I will stick with AutoIt which I have used a lot.

I meant launch and send to active window in the same card :-)
Post Reply