Sign in to follow this  
Followers 0
gchichester

Waiting for Key

6 posts in this topic

Yes, I'm new to AutoIt, but I have been using Winbatch for awhile.

I'm working on automating a vertical market application that didnt

have the end-user in mind when it was developed. What Im look for

is a simply way to fill out forms without moving back and forth between

the keyboard and mouse. I need a way in AutoIt to pause the script while

user enter data into a textbox then press say the F12 key to advance the script

to the next field. I could not find any function or command that does something

like WaitForKey.

Any and all input would be appreciated.

gchichester

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <Misc.au3>

;;;;code



;Wait for F12
Do
Sleep(50)
Until _IsPressed("7B")

;;;continue code

Edited by TehWhale

Share this post


Link to post
Share on other sites

Yes, I'm new to AutoIt, but I have been using Winbatch for awhile.

I'm working on automating a vertical market application that didnt

have the end-user in mind when it was developed. What Im look for

is a simply way to fill out forms without moving back and forth between

the keyboard and mouse. I need a way in AutoIt to pause the script while

user enter data into a textbox then press say the F12 key to advance the script

to the next field. I could not find any function or command that does something

like WaitForKey.

Any and all input would be appreciated.

gchichester

Look up HotKeySet. But couldn't the user just press TAB? Well I suppose not, so then possibly ControlFocus might be useful to set the focus to a particular edit.

Welcome to the AutoIt forums :)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

@Martin

I remember that hotkeyset block "hotkeys" for others programs... like hotkey is reserved for script only :) and context menu of explorer beug perhaps it has been fixed...

Thats why i use _IsPressed...

Anyway this was a little note from me ...


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Welcome To The Forums! ^^; Also.. This Might Help :

; This Is Needed For The.. " _IsPressed () Function "
#Include <Misc.Au3>

; _IsPressed () Constants.. Or " HexKeys " Visit :
; http://www.autoitscript.com/forum/index.php?showtopic=73259

; Example.. 
; _WaitForKey ('7B') ; 7B = F12
; MsgBox ('0','Notice','Key : F12.. Was Pressed','0')

Func _WaitForKey ($Hex_Key, $Sleep = '50')
Do 
Sleep ($Sleep)
Until _IsPressed ($Hex_Key)
EndFunc
Edited by John2006

Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

Thanks to all for sharing your knowledge so freely and being so fast about it.

I think Im going to like working with AutoIt and thanks for such a warm welcome to the forum.

Maybe one day soon I'll be able to help a newbie.

gchichester

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