sd333221 Posted August 10, 2006 Posted August 10, 2006 (edited) I want my script, if "{SPACE}" gets pressed, to do nothing (Sleep(1500)), and after 1.5sec to interrupt it for 1 Sec, by "BlockInput(1)"... Then it can go on... So i need the Space-Key to be still sended and to be interrupted for 1 sec after 1.5 sec... Also i need multi-call protection (i get recursion overflow sometimes) My problem is, that if i do it like its in the bottom, the {Space} Key wont be sent... also if i do Send( "{Space}" ) but i dont want to send Space i want the key to be hold down.. not only to send it I hope you can help me, thank you so much HotKeySet("{SPACE}", "Input") ;;;; Body of program would go here ;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func Input() ;Send( "{SPACE}" ) <- this aint gonna work lol...... Sleep( 1500 ) blockinput( 1 ) Sleep( 1000 ) blockinput( 0 ) EndFunc Edited August 10, 2006 by sd333221
Moderators SmOke_N Posted August 10, 2006 Moderators Posted August 10, 2006 (edited) HotKeySet("{SPACE}", "Input") ;;;; Body of program would go here ;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func Input() HotKeySet('{SPACE}') Send(' ') Sleep(1500) blockinput( 1 ) Sleep(1000) blockinput(0) HotKeySet('{SPACE}', 'Input') EndFunc Edit: Oops, Larry already did it. Edited August 10, 2006 by SmOke_N 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.
sd333221 Posted August 10, 2006 Author Posted August 10, 2006 (edited) expandcollapse popupHotKeySet("{SPACE}", "Input") HotKeySet("{ESC}", "ESC") ;;;; Body of program would go here ;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func Input() HotKeySet("{SPACE}") Send("{SPACE}") HotKeySet("{SPACE}","Input") Sleep( 1500 ) blockinput( 1 ) Sleep( 2000 ) blockinput( 0 ) EndFunc Func ESC() EXIT EndFunc oÝ÷ Ù8b²+'¢Ü(®H§«"·l²êi¢Ç¶h"×+jÈ^vl¢jnµêç£pÇ·ß}÷ß}÷ß}÷ß}È*.Á©çjIèÃrr©W¢µ©Ýµë-bjxhÔ©iǧ£§v+p¢¹,nëbµÚ²}ý¶²Ú)¥çZ~׫×q8^~éܶ*'ÆÞxjY^vh¥*'²íg¬ü¨ºËh¦Þ²È§+ZÜ×è¯],yËayÊ&¦ë^úÞ{7¬jwb·l~Þ½êç¢Ö¬f§jx®zH"-¢yr«-¡·jY^vÜzì¢g)à¢Ø^¯Ó¨¢l¶§*.Jj$z+l)ºÆ¢vl®åzl°Ú-jëh×6Func Input() HotKeySet("{SPACE}") Send("{SPACE}") HotKeySet("{SPACE}","Input") Sleep( 1500 ) blockinput( 1 ) Sleep( 2000 ) blockinput( 0 ) EndFuncoÝ÷ Ù¬jëh×6 Func Input() HotKeySet("{SPACE}") Send("{SPACE}") Sleep( 1500 ) blockinput( 1 ) Sleep( 2000 ) blockinput( 0 ) HotKeySet("{SPACE}","Input") EndFunc Was a missunderstanding, thousands thanks go to you, guys Edited August 10, 2006 by sd333221
GaryFrost Posted August 10, 2006 Posted August 10, 2006 (edited) Edit: too slow today. Edited August 10, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
sd333221 Posted August 10, 2006 Author Posted August 10, 2006 I wonder why blockinput( 1 ) It interrupts Space for 1 secound, do you know a better solution to block a single key? If yes, let me know
Bert Posted August 10, 2006 Posted August 10, 2006 use hotsetkey, and have it so when that key is pressed, it just runs a short sleep statement. The Vollatran project My blog: http://www.vollysinterestingshit.com/
CoePSX Posted August 11, 2006 Posted August 11, 2006 Opt("SendKeyDownDelay", 1500) Func Input() Send("{Space}") Sleep(2000) EndFunc There. It holds space for 1,5 second and waits 2 seconds [quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"]╔══════════════════════════════╗║░░██░░░░░░░░██░░███░░░████░░░█║║░█░░█░░██░░█░░█░█░░█░█░░░░█░█░║║░█░░░░█░░█░████░███░░░██░░░█░░║║░█░░█░█░░█░█░░░░█░░░░░░░█░█░█░║║░░██░░░██░░░██░░█░░░░███░█░░░█║╚══════════════════════════════╝[/font]
AutoChris Posted August 11, 2006 Posted August 11, 2006 I think what volleyman was thinking about was something more like: HotKeySet("{SPACE}", "SleepyTime") Func SleepyTime() Sleep(1500) EndFunc
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now