PDA

View Full Version : Question: SendKeys Function?



NewsArchive
02-07-2006, 12:22 AM
We have added a new function to our internal SetupBuilder 5.3 IDE. The
compiler can now automatically fill the code signing password pop-up window.

To handle this, we have developed a function to send keystrokes to other
applications. The function provides similar functionality to that of the
Visual Basic SendKeys function.

Supported keywords:

{ENTER}{ESC}{UP}{DOWN}{LEFT}{RIGHT}{F1}-{F16}{WIN}{BACKSPACE}or{BS}or{BACK}
{HOME}{END}{PGUP}{PGDN}{PRTSC}{TAB}

{INS}or{INSERT}(CAPSLOCK}{SCROLLLOCK}{HELP}{BREAK} or{CANCEL}{CARRIAGERETURN}
{LINEFEED}{FF}{DEL}or{DELETE}{CHR nnn}

{NUMLOCK}

For example (send this to the active window):

SendKeys("Steelers win fifth Super Bowl title!{ENTER}")

-or-

{LEFT 5} means press the LEFT ARROW key 5 times, {s 5} means press s 5
times.

Question: Would you like to have this function available in the SetupBuilder
script editor?

--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 5

NewsArchive
02-07-2006, 12:22 AM
Friedrich,

This function would be welcome, but this strikes me as being a bit slow.
Instead, can we simply type in the text we want, then when saving, your
script editor "formats" it for us?

--
Russ Eggen
www.radfusion.com

NewsArchive
02-07-2006, 12:23 AM
Russ,

My intention was to provide the SendKeys function to send keys or phrases
to an application using SetupBuilder (scripts).

We cane even specify keys combined with any combination of the SHIFT, CTRL,
and ALT keys, precede the key code with one or more of the following codes:

+ = Shift
^ = Ctrl
% = Alt

For example: SendKeys "%{F4}"

This command sends (from the setup.exe) the "Alt + F4" command to, say,
Wordpad. Wordpad will then ask if you would like to save. Now just send
the "n" key.

What do you think?

Friedrich

NewsArchive
02-07-2006, 12:23 AM
Friedrich,

I really, REALLY like the concept! ;-) For simple things like your example,
I can certainly see it being useful as-is. What I was driving at is
something like a macro recorder, you do all the need keystrokes, save them
and then replay the macro with the SendKeys function. I'm thinking of
streaming editing kinda like Unix's sed.

A good use is for example, getting input of the CRC value of what is being
installed, open Word, new document, some formatting commands, then produce
an invoice with all the custom data about *this* installation, all at a
client's install site. I have a client who has company policy to not
install any product without the vendor's CD or proof of purchase (he bought
a company who had software audits and they did not pass). But something
like a fancy receipt and proof of valid install would satisfy his needs.

Perhaps I jumped a few spaces ahead of where you are? ;-)

--
Russ Eggen
www.radfusion.com

NewsArchive
02-08-2006, 12:01 AM
Russ,

Aha, I see what you mean. Yes, you jumped quite a few steps ahead of where
I am ;-)

Thanks,
Friedrich

--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 5