pkil_k Posted February 23, 2020 Share Posted February 23, 2020 hi Folks.. i began writing AutoIt scripts about 5 years ago.. for gaming purposes mainly. then i realised just how powerful this platform is.. a couple of points maybe ppl can help clarify for me :- i was unsure whether Beep is synchronous or asych.. seems to be synchronous yeh? is there any way to make a block atomic? (critical section) i use hotkeys but i need some way to pass on keyboard events ie. not consume any suggestions? ty... Link to comment Share on other sites More sharing options...
Nine Posted February 23, 2020 Share Posted February 23, 2020 That should answer your questions : ;https://www.autoitscript.com/forum/topic/199762-udf-blockinputex/ #include "..\BlockInput\BlockInputEX.au3" ConsoleWrite ("Question 1" & @CRLF) $hTimer = TimerInit () Beep (800, 2000) ConsoleWrite (TimerDiff ($hTimer) & @CRLF) ConsoleWrite ("Question 2" & @CRLF) _BlockInput ($BI_DISABLE) ; block ;do your stuff here ConsoleWrite ("you are blocked : critical section" & @CRLF) Sleep (10000) ;nothing much you can do to interupt _BlockInput ($BI_ENABLE) ; unblock ConsoleWrite ("Question 3 - press a" & @CRLF) HotKeySet ("a", _F) While True Sleep (100) WEnd Func _F () HotKeySet ("a") ; temp remove hot key Send ("a") ConsoleWrite ("Sent a" & @CRLF) HotKeySet ("a", _F) ; reset hot key EndFunc “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Developers Jos Posted February 23, 2020 Developers Share Posted February 23, 2020 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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