Page 1 of 1
"Keys to send" problem
Posted: Sat Mar 02, 2019 7:37 pm
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
Re: "Keys to send" problem
Posted: Sat Mar 02, 2019 10:28 pm
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.
Re: "Keys to send" problem
Posted: Sun Mar 03, 2019 1:57 am
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
Can I launch an application and send keys to active window, instead using a 2nd card for active window?
Re: "Keys to send" problem
Posted: Sun Mar 03, 2019 7:29 am
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.
Re: "Keys to send" problem
Posted: Sun Mar 03, 2019 9:29 am
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 "/"?
Re: "Keys to send" problem
Posted: Sun Mar 03, 2019 6:19 pm
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?
Re: "Keys to send" problem
Posted: Sun Mar 03, 2019 8:27 pm
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".
Re: "Keys to send" problem
Posted: Sun Mar 03, 2019 9:56 pm
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