Sign in to follow this  
Followers 0
Nucks

ALT + Numpad at same time

10 posts in this topic

Hello,

I want to thank everyone for their help, even though you didn't realize you were helping me. I have searched the forums and read the help file. I almost have this script down but one thing isn't working right.

HotKeySet("{F12}", "Stop")

HotKeySet("{F11}", "Start")

While 1

Sleep(100)

WEnd

Func Stop()

Exit 0

EndFunc ;==>Stop

Func Start()

While 1

Send('2')

Sleep(500)

Send('5')

Sleep(500)

Send('4')

Sleep(500)

Send('6')

Sleep(3000)

Send('8')

Sleep(3000)

Send('!9')

Sleep(3000)

Send('!7')

Sleep(3000)

Send('6')

Sleep(3000)

Send('9')

Sleep(3000)

Send('2')

Sleep(500)

Send('4')

Sleep(500)

Send('5')

Sleep(500)

Send('!9')

Sleep(3000)

Send('!8')

Sleep(3000)

Send('6')

Sleep(3000)

Send('0')

Sleep(3000)

Send('!9')

Sleep(3000)

Send('-')

WEnd

EndFunc ;==>Start

Any time I use the Send('!9) [anything with !] it does not use it as ALT. The program is acting as if the ! is not there. I experimented and put a + in and it did the shift correctly.

Any thoughts would be appreciated and I will continue to lurk to learn more.

Thank you.

Share this post


Link to post
Share on other sites



Seems to work fine for me:

HotKeySet('!9', '_Test')

Sleep(3000)
Send('!9')

Func _Test()
    MsgBox(64, 'Info', 'Alt + 9 was pressed.')
EndFunc


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I have been working with it some more and I noticed something interesting. Every once in a while it would work for hitting the ! (ALT) but it would never hit the ! everytime it was suppose to.

I even tried doing this script but it wouldn't work on a consist basis.

Send ('{ALTDOWN}')

Send ('9')

Send ('{ALTUP}')

Sleep (3000)

But when I manually work in the program ALT+9 works 100% of the time. I will keep looking around and maybe another suggestion will come.

thank you

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Now, are you trying to use the number 9 on the *number pad*? If so you must use {NUMPAD9} and not 9.

Edited by EWOlson

Share this post


Link to post
Share on other sites

I see the error in my title. I am trying to use the "9" the is above the letter I on the keyboard. But this still works once in a while which I can't figure out.

Share this post


Link to post
Share on other sites

And the code that you have above is exactly what you are using?

Share this post


Link to post
Share on other sites

Yes it is. I copied and pasted it right out of the file for a3.

Share this post


Link to post
Share on other sites

OK, I knew I had seen something that had to do with button presses and games. (I'm assuming this is a game question.) The value is SendKeyDownDelay. It defaults to 5 milliseconds, and it sounds like you need to increase that.

AutoItSetOption("SendKeyDownDelay", 10)

Share this post


Link to post
Share on other sites

Thank you EWOlson. That was it exactly. I had to up the milliseconds to 30 and it worked perfectly. Never even thought of that one.

Case Closed

Share this post


Link to post
Share on other sites

You are quite welcome. Glad to be of help.

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  
Followers 0