IIIRAZORIII Posted March 10, 2013 Share Posted March 10, 2013 (edited) Hey Guys Curious if your able to help me, i'm trying to use a block Input script along with a toggle pause, atm i'm just testing trying to toggle the block/unblock along with the pause script toggle. i've included the UDF files i'm using with block input function. but can;t rly make head or tales as to the edits i need to make to the UDF. the script current has two functions in it atm while i'm testing. the end result should be as follows.... {PAUSE} = TogglePause and also Toggle Input block ^{PAUSE} = Terminate my test script so far, excuse the mess, had to keep functions from both scripts to keep my computer from freaking out. expandcollapse popup#include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("^{PAUSE}", "Terminate") HotKeySet("{PAUSE}", "_Quit") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") ;This is only for testing, so if anything go wrong, the script will exit after 10 seconds. AdlibRegister("_Quit", 10000) While 1 Sleep(100) WEnd Func _Quit() Exit EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is Paused',1047,0," Warning",0,4) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFuncBlockInputEx_UDF_1.6.zip Edited March 10, 2013 by IIIRAZORIII Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 10, 2013 Share Posted March 10, 2013 I couldn't test because I'm currently on a laptop without {PAUSE} key but it should work#include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused = False HotKeySet("{PAUSE}", "TogglePause") HotKeySet("^{PAUSE}", "_Quit") ;~ HotKeySet("{PAUSE}", "_Quit") ;<<<<<<<<<<<<<<<<<<<<<<<<<< you cannot register two functions simultaneously for the same key. ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") ;This is only for testing, so if anything go wrong, the script will exit after 10 seconds. AdlibRegister("_Quit", 10000) While 1 If $Paused Then While $Paused Sleep(100) ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) WEnd Else ToolTip('') EndIf WEnd Func _Quit() Exit EndFunc ;==>_Quit Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
IIIRAZORIII Posted March 10, 2013 Author Share Posted March 10, 2013 unfortunate not both hotkeys had no effect, Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 10, 2013 Share Posted March 10, 2013 Strange. I tested in my computer and it perfectly works The mouse and keyboard are blocked except the PAUSE key pressing the pause key shows a tooltip that the Script it paused, again pressing it removes the tooltip The script remains in state for 10secs... Which version of Autoit are you using and what is your environment ? IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
IIIRAZORIII Posted March 10, 2013 Author Share Posted March 10, 2013 (edited) Strange. I tested in my computer and it perfectly worksThe mouse and keyboard are blocked except the PAUSE keypressing the pause key shows a tooltip that the Script it paused, again pressing it removes the tooltipThe script remains in state for 10secs...Which version of Autoit are you using and what is your environment ?did you make any edits to the BlockInputEx.au3 file ?for me the toggle pause works but input remains blocked.and the "control pause" no longer Quits, need to wait out the timer Edited March 10, 2013 by IIIRAZORIII Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 10, 2013 Share Posted March 10, 2013 Nowhere we are freeing the input Hence input would remain blocked Where do you want to unblock the user input IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
IIIRAZORIII Posted March 10, 2013 Author Share Posted March 10, 2013 when script is paused, input should but unblocked, then when unpaused, the input should be blocked. on other words if the script is running the input should be blocked, when the script is pause or finished input should be unblocked Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 10, 2013 Share Posted March 10, 2013 (edited) Maybe this would do how you are preferring BTW: I have removed the Quit after 10secs#include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused = False, $iBlocked = False HotKeySet("{PAUSE}", "TogglePause") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") While 1 If $Paused Then While $Paused Sleep(10) If $iBlocked Then _BlockInputEx(0) $iBlocked = False ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) AdlibRegister("Tip", 4000) EndIf WEnd ElseIf Not $iBlocked Then _BlockInputEx(1, "0x13") $iBlocked = True EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func Tip() ToolTip('') AdlibUnRegister("Tip") EndFunc ;==>Tip Thumbs up if it helped Edited March 10, 2013 by PhoenixXL IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
IIIRAZORIII Posted March 10, 2013 Author Share Posted March 10, 2013 (edited) so far so good worked as intended. still ^Pause doesn't work obviously as its removed, but guessing your working on this now ? and thank you btw, this is awsome help Edited March 10, 2013 by IIIRAZORIII Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 10, 2013 Share Posted March 10, 2013 (edited) expandcollapse popup#include <BlockInputEx.au3> ;================== Exclude usage Example ================== Global $Paused = False, $iBlocked = False, $iExit_Timeout = 11000 ;11secs HotKeySet("{PAUSE}", "TogglePause") HotKeySet("^{PAUSE}", "Quit") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13") AdlibRegister("Quit", $iExit_Timeout ) While 1 If $Paused Then While $Paused Sleep(10) If $iBlocked Then _BlockInputEx(0) $iBlocked = False ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) AdlibRegister("Tip", 4000) EndIf WEnd ElseIf Not $iBlocked Then _BlockInputEx(1, "0x13") $iBlocked = True EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func Tip() ToolTip('') AdlibUnRegister("Tip") EndFunc ;==>Tip Func Quit() _BlockInputEx(0) Exit EndFunc Edited March 10, 2013 by PhoenixXL IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
IIIRAZORIII Posted March 10, 2013 Author Share Posted March 10, 2013 (edited) Not Sure why but this didn't work even after editing to _BlockInputEx(1, "0x13|0x11") which i thought would have been the issue since control key is blocked. atm though with the following, i can quit while in pause, but i am requiered to pause first before quit. expandcollapse popupGlobal $Paused = False, $iBlocked = False, $iExit_Timeout = 11000 ;11secs HotKeySet("{PAUSE}", "TogglePause") HotKeySet("^{PAUSE}", "Quit") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0x13|0x11") AdlibRegister("Quit", $iExit_Timeout ) While 1 If $Paused Then While $Paused Sleep(10) If $iBlocked Then _BlockInputEx(0) $iBlocked = False ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) AdlibRegister("Tip", 4000) EndIf WEnd ElseIf Not $iBlocked Then _BlockInputEx(1, "0x13|0x11") $iBlocked = True EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func Tip() ToolTip('') AdlibUnRegister("Tip") EndFunc ;==>Tip Func Quit() _BlockInputEx(0) Exit EndFunc Edited March 10, 2013 by IIIRAZORIII Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 11, 2013 Share Posted March 11, 2013 (edited) Try thisAlt + Pause - Quit the scriptexpandcollapse popup#include <BlockInputEx.au3> Global $Paused = False, $iBlocked = True, $iExit_Timeout = 11000 ;11secs HotKeySet("{PAUSE}", "TogglePause") HotKeySet("!{PAUSE}", "Quit") ;All keyboard keys and mouse clicks are blocked except these keys: 0x13 = {PAUSE} _BlockInputEx(1, "0xA4|0x13") AdlibRegister("Quit", $iExit_Timeout) ;~ MsgBox(64 , '', $ah_MouseKeyboard_WinHooks[5], 5 ) While 1 If $Paused Then While $Paused Sleep(10) If $iBlocked Then _BlockInputEx(0) $iBlocked = False ToolTip('Script is Paused', 1047, 0, " Warning", 0, 4) AdlibRegister("Tip", 4000) EndIf WEnd ElseIf Not $iBlocked Then _BlockInputEx(1, "0xA4|0x13") Tip() $iBlocked = True EndIf WEnd Func TogglePause() $Paused = Not $Paused EndFunc ;==>TogglePause Func Tip() ToolTip('') AdlibUnRegister("Tip") EndFunc ;==>Tip Func Quit() _BlockInputEx(0) Exit EndFunc ;==>QuitYou forgot one thing, when we press Ctrl+Pause ETX is posted not pause neither ctrl.the hex code for ETX is 0x03 but when you add it to the exclude list, the combination would be posted but the hotkey would not be triggered.Simultaneously Scite even uses Ctrl+Break to exit the scriptI therefore used Alt+Pauseand the hex code for Alt is 0xA4Hope this helpsRegards Phoenix XL Edited March 11, 2013 by PhoenixXL IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
IIIRAZORIII Posted March 11, 2013 Author Share Posted March 11, 2013 i think i understand, thank you so much for your help with this btw, only started learning autoit a few days ago, so this was a little over my head : ) working perfect now using Alt+Pause for exit. Link to comment Share on other sites More sharing options...
PhoenixXL Posted March 11, 2013 Share Posted March 11, 2013 glad to be of service regards IIIRAZORIII 1 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. 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