Jump to content

How to fix this problem about send key?


nhatdear
 Share

Recommended Posts

This is my code:

$Hand=WinGetHandle("My notepad")

$i = 0

Do

ControlSend ($Hand,"My notepad","","{5}")

$i=$i+1

Sleep(8000)

Until $i=100000

So, the problem is : after 8 seconds, it will send to My notepad key "5", but if i type any key, for example i type key "L" at the time 8s after ControlSend, it will send key "L" instead of sending key "5" !!! Why? And how do i fix it? Please tell me some idea!

Thank for reading and sorry for my English......

Link to comment
Share on other sites

This will send "5" to the "My notepad" window.

$i = 0
Do
ControlSend ("My notepad","","","{5}")
$i=$i+1
Sleep(8000)
Until $i=100000

I think this works, but I think what you're talking about is making every keystroke you type show type in the "My notepad" window.

:) Just my opinion.

[center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]
Link to comment
Share on other sites

btw wouldn't it have been better with a for...next loop ?

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

You should open new document, and keep press down key "L", you will see in "My Notepad" , key "L" will be sent

still sends key 5..... even if i keep the L key HELD down... Edited by Aceguy
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...