Jump to content
Sign in to follow this  
Geoffl

Send value to F keys

Recommended Posts

Geoffl

Hi,

I am totally new to this and am wondering if someone can point me in the right direction. I need to reprogram the F8 , F9 and F10 keys. We use these keys in a Dos program to change functions. With Ansi.sys "prompt $e[0;68;"999";13p " loads the F10 key with '999'. How can I do this with Autolt?

Regards

Geoffl

Share this post


Link to post
Share on other sites
SlackerAl
HotKeySet

Send

 

Edited by SlackerAl

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Share this post


Link to post
Share on other sites
Geoffl

HotKeySet send what?

Share this post


Link to post
Share on other sites
SlackerAl

Click on them for help file and examples, those two will let you Send keystrokes when a HotKeySet is pressed....

  • Like 1

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Share this post


Link to post
Share on other sites
Geoffl

Sorry, I don't understand this at all. Could someone tell me what code I need to send 999 to key F10?

Regards

Geoffl

Share this post


Link to post
Share on other sites
Geoffl

Here is what I have. Can anyone tell me what is wrong?Screenshot (1).png

Share this post


Link to post
Share on other sites
spudw2k

Take a closer look at the example in the help file.

For HotKeySet, the second parameter is the name of a function to be called when the first parameter--key(s)--are pressed.  You need to build the function and put the send function inside of it.  Example #1 in the help file illustrates the usage this well.

 

Share this post


Link to post
Share on other sites
Geoffl

Hi,

Thank you for your reply. I have spent 30 years programming in an archaic dos language but  I have no concept of what autolt is all about. To me it is like trying to write a program in Yiddish. All I want to do is load '999' into key F10. Can't anyone help me?

Share this post


Link to post
Share on other sites
SlackerAl
HotKeySet("{F10}", "SendKeys")
 
While 1
  Sleep(100)
WEnd

Func SendKeys()
  Send("999")
EndFunc

 

  • Like 1

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Share this post


Link to post
Share on other sites
Geoffl

Thank you so much for your help

Regards

Geoffl

Share this post


Link to post
Share on other sites
spudw2k

Let me ask you this, now that someone did the work for you, can you see how @SlackerAl code looks like the examples in the help file? 

May I suggest next time someone point to the help file--particularly when there are good examples--you might want to try playing with the examples and see what breaks them and tweak them to make your desired result work.  Having an understanding on what the code is doing and affording some creativity and exploration is much more rewarding.

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×