RL008 Posted March 3, 2010 Share Posted March 3, 2010 (edited) hello! I'm trying to block user from interfering with program using " BlockInput ( 1 )". the problem is that I want to check is user tried to press any key and in that case stop the program and enable the keyboard & mouse again. thank! Edited March 3, 2010 by RL008 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2010 Moderators Share Posted March 3, 2010 RL008, I am afraid I do understand what you are trying to do. As I read your post, you want an application to run without user input until there is some user input, at which point you accept user input. So why bother blocking the input at all if you want the block to be lifted as soon as the user attempts an input? Or have I conpletely misunderstood what you want? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
RL008 Posted March 3, 2010 Author Share Posted March 3, 2010 RL008,I am afraid I do understand what you are trying to do.As I read your post, you want an application to run without user input until there is some user input, at which point you accept user input. So why bother blocking the input at all if you want the block to be lifted as soon as the user attempts an input?Or have I conpletely misunderstood what you want? M23I dont want the user to interfering with the program but I want to have a choice to terminate the program in a control way. If user want to terminate the program he will press something and the program will recognize it and will finish the last action and only then it will shutdown. another choice can be to disable all key and mouse accept one button (for example "Esc"), but I dont know how to do it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2010 Moderators Share Posted March 3, 2010 RL008,This is one way you can stop a running funciton with a HotKey:expandcollapse popup#include <GUIConstantsEx.au3> HotKeySet("{ESC}", "_Stop") $hGUI = GUICreate("Test", 500, 500) $hLabel_1 = GUICtrlCreateLabel("", 10, 10, 100, 20) $hlabel_2 = GUICtrlCreateLabel("", 10, 50, 100, 20) GUISetState() $fFlag = True _Function() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Function() GUICtrlSetData($hLabel_1, "Running") While $fFlag = True Sleep(1000) GUICtrlSetData($hLabel_2, @SEC) WEnd GUICtrlSetData($hLabel_1, "Stopped") EndFunc Func _Stop() $fFlag = False EndFuncDoes it help? What is the program that you do not want the user to interact with? Is it an AutoIt script or something else?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
RL008 Posted March 3, 2010 Author Share Posted March 3, 2010 RL008,Does it help? What is the program that you do not want the user to interact with? Is it an AutoIt script or something else?M23Thanks but it dont help. the programe is a Autoit script and it perform auto test in anouther program.if someone will touch the keyboard or maouse it may inerfire the script.so I need to disable all key accept Esc for example so if the user press this button the script will know to stop after it finish it last process. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2010 Moderators Share Posted March 3, 2010 RL008, I have been searching the forum and I found this thread which might help. It says it can block user input for specific windows or all input other than specific keys. I hope that helps, because I am out of ideas otherwise. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
RL008 Posted March 3, 2010 Author Share Posted March 3, 2010 RL008, I have been searching the forum and I found this thread which might help. It says it can block user input for specific windows or all input other than specific keys. I hope that helps, because I am out of ideas otherwise. M23 Thanks! I t will do the job. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2010 Moderators Share Posted March 3, 2010 RL008, I like happy endings! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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