ZiggyStardust Posted April 14, 2012 Share Posted April 14, 2012 (edited) I am writing a little program with a "Quit" routine and don't really want the users to know what it is so I made it a little difficult: HotKeySet("^!+{ESC}", "Quit") ;crtl-alt-shift-esc The problem I am having is getting _BlockInputEx to allow that combibation: _BlockInputEx(1, "^!+{ESC}") The quit routine works great until I invoke the InputEX(). Any idea what I am missing? Edited April 14, 2012 by Melba23 Removed formatting rubbish from beginning of lost Link to comment Share on other sites More sharing options...
AussieTimmeh Posted April 19, 2012 Share Posted April 19, 2012 I have joined the forums specifically to start thanking those that have taken the time to help others like myself with great things like this. Thank you for your work on this great include, I appreciate it. Link to comment Share on other sites More sharing options...
ZiggyStardust Posted April 19, 2012 Share Posted April 19, 2012 Still experiencing some wierd issues with the BlockInputEx. In addition to the issue mentioned above I have another oddity. This little program I am working on makes extensive use of BlockInputEx. Users testing it do so by simplely "banging" on the keyboard. Just typing every key rapidly and randomly. There have been several occassions where it gets to a point where the arrow keys start rotating the screen. In searching I have found that the Intel Graphics Media Acceleration is running and present down by the clock. In looking at it the arrow keys do rotate the screen but have to be preceed by a ctrl-alt. Something the users are hitting is essentially setting the ctrl-alt keys as being in effect (held down) at which point the arrow keys rotate the screen because the ctrl-alt keys are "stuck" in the down position. Any ideas what the users could be hitting to allow the ctrl-alt keys to be stuck in the pressed position? Link to comment Share on other sites More sharing options...
ZiggyStardust Posted June 3, 2012 Share Posted June 3, 2012 I am going to beg, plead and offer my first born for some help. I love what this BlockInputEx is supposed to do but I am dying. In addition to the problems with the Quit sequence two posts above I have encountered yet another issue asked here on two occassions but never answered. I need to do a MouseClick() with the primary mouse button but can't seem to get the click through BlockInputEx(). Here is what I Have: Global $BlockExempt = "{F5}|^{F5}|{LEFT}|{RIGHT}|{UP}|{DOWN}|{PGUP}|{PGDN}|{ENTER}|{MPDOWN}|{MPUP}" _BlockInputEx(1, $BlockExempt) The MouseClick() will will not work. _BlockInputEx blocks it. I have read the docs on BlockInputEx until I am blue in the face. I am missing something simple I just can't figure out what. SOS! HELP! PLEASE I AM BEGGING! Link to comment Share on other sites More sharing options...
SHOAnimal Posted July 6, 2012 Share Posted July 6, 2012 (edited) @ZiggyStardust What you are trying to do may not be possible. The ability for your script to use send() and mousemove() or mouseclick() is not in the UDF. as for the key combo for your Quit you can exclude the keys you need and then use the combo, but each key can also be pressed individually though. I am going to look into things and see if i can try to come up with code to Fix the mouseclick issue as well as key combos, although i wouldn't get too excited as i am no pro with programming. Edited July 6, 2012 by SHOAnimal Link to comment Share on other sites More sharing options...
zone97 Posted November 20, 2012 Share Posted November 20, 2012 Hello, love this addon, but had an issue with it. I have a script that I use that forces the caps lock on while in a particular app. However the users have found that they can bypass this by using the shift key. I wanted to use your add on to fix this but found some issues. 1st, when i added the code, to turn it on and then off when out of the window, after a little while it would produce an application crash. It would work until then. 2nd, I only need to prevent the shifting of letters, not numbers or symbols. here is the app without the changes (had to undo and didnt save what I had added sorry.) expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=allcaps.ico #AutoIt3Wrapper_Outfile=lockcaps.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #App by Frank Glover #include HotKeySet("^!Q", "_Quit") HotKeySet("^!q", "_Quit") Global $VK_CAPITAL = 0x14 Break(0) Dim $version = "1.3a" Local $hDLL = DllOpen("user32.dll") Opt("SendCapslockMode", 0) TraySetToolTip("LockCaps "&$version) Global $PreviousCAPSOFF;CAPSLOCK OFF While 1 WinWaitActive("[Class:ThunderRT6FormDC]") $PreviousCAPSOFF = _GetCapslock() = 0 If $PreviousCAPSOFF Then Send("{CAPSLOCK on}") While WinActive("[Class:ThunderRT6FormDC]") Send("{CAPSLOCK on}") Sleep(10) WEnd If $PreviousCAPSOFF Then Send("{CAPSLOCK off}") WEnd Func _GetCapslock() Local $aRet = DllCall("user32.dll", "int", "GetKeyState", "int", $VK_CAPITAL) Return $aRet[0] EndFunc ;==>_GetCapslock Func _Quit() Exit EndFunc ;==>_Quit any help will be apreciated. Spoiler WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ] Link to comment Share on other sites More sharing options...
MrCreatoR Posted May 12, 2013 Author Share Posted May 12, 2013 Update... [v1.8 - 12.05.2013, 12:16]* Fixed issue when some numeric keyboard keys was not blocked.* Fixed issue when ALT+Tab was not blocked. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
JohnOne Posted May 19, 2013 Share Posted May 19, 2013 I've seen similar questions to this one asked "regarding windows" but as yet unanswered. I'm wondering if it possible with your UDF's to accomplish the following... Block UP DOWN LEFT RIGHT to all but autoit window. The goal is to give these keys mouse functionality, but without interacting with any active windows such as scrolling a webpage or any other application specific tasks. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
AcidUser Posted August 13, 2013 Share Posted August 13, 2013 (edited) Hello! Very useful script, thank you very much for your effort. I think I have found a serious bug: I can set exclusions for BlockInputEx like this: BlockInputEx(1,"{F1}|{F2}") This works fine. However when I press CTRL+ALT+DEL (on Windows 7) - Windows Security window opens, then I press "Cancel" to close this window. And after this Input does not work as specified in this UDF description. The problem is that after "CTRL+ALT+DEL" BlockInputEx exclusions (F1 and F2) also do not work! Could this be somehow solved ? I've tried digging into code but did not understand where exclusions might be lost after CTRL+ALT+DEL. P.S: I thought it was problem in my code, but after checking on UDF example - "Example - Exclude usage.au3" behavior was the same. Thank you in advance for help! Edited August 13, 2013 by AcidUser Link to comment Share on other sites More sharing options...
AcidUser Posted August 14, 2013 Share Posted August 14, 2013 anyone has experienced same problem ? Link to comment Share on other sites More sharing options...
FireFox Posted August 14, 2013 Share Posted August 14, 2013 Hi,Please wait at least 24 hours before bumping.Br, FireFox. Link to comment Share on other sites More sharing options...
FireFox Posted August 14, 2013 Share Posted August 14, 2013 This example works for me (even after pressing Ctrl+Alt+Del) :#include <BlockInputEx.au3> ;================== Exclude usage Example ================== HotKeySet("{F1}", "_Quit") HotKeySet("{F2}", "_Quit") ;All keyboard keys and mouse clicks are blocked except these keys: 0x1B = {ESC}, 0x70 = "{F1}", 0x71 = "{F2}", 0x72 = "{F3}" ;~ _BlockInputEx(1, "0x1B|0x70|0x71|0x72") _BlockInputEx(1, "{F1}|{F2}") ;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 Link to comment Share on other sites More sharing options...
AcidUser Posted August 14, 2013 Share Posted August 14, 2013 Hi, Firefox, thanks for responding. I test scripts on a VmWare Virtual Machine "Windows 7". Physical PC is Windows 8. So maybe that bug is on VmWare only, I'll check that and report back. One significant difference between Physical PC and Virtual Machine is that VMware works with "CTRL + ALT + INSERT" key mapping instead of traditional "CTRL + ALT + DEL". Link to comment Share on other sites More sharing options...
AcidUser Posted August 17, 2013 Share Posted August 17, 2013 Hello, I can confirm that this problem happens on virtual machines. I used "Windows 7 x64" on VMware and after CTRL+ALT+DEL pressed "BlockInputEx" exclusion keys do not work anymore. Posting this, due to more skilled Autoit guru might consider to fix this. Thanks. Link to comment Share on other sites More sharing options...
lancebh Posted September 14, 2013 Share Posted September 14, 2013 Hello All, ControlGetPos ControlClick ControlSend Send MouseClick ...(and more) These all tend to allow the mouse to move (just a small amount, but enough to cause issues with my script). Is there any suggestions to fix this? Any help is welcome Link to comment Share on other sites More sharing options...
Jorin Posted November 18, 2013 Share Posted November 18, 2013 I dont really understand how to use the blockinputex function. Should i use the blockinputex.au3 and start my script from line 443 and leave the rest as it is? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2013 Moderators Share Posted November 18, 2013 Jorin,The UDF is just an include file - so make sure you have saved the BlockInputEx.au3 file in the same folder as your script, add#include <BlockInputEx.au3>at the top of your script and you can use the various fuctions within it without problem. If you think that you might want to use the UDF in several scripts, you might want to read the Adding UDFs to AutoIt and SciTE tutorial in the Wiki to see how you can best do this. 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...
Jorin Posted November 19, 2013 Share Posted November 19, 2013 (edited) So I want to block all input for the ninite.exe window. Yesterday I have been struggeling with this a while, but I dont seem to get close to the solution. Could anyone help me out with this? The way it is now, no input is blocked. #include <BlockInputEx.au3> If Not $CMDLINE[0] Then RunAs('***', '****', '****', 5, '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart') If @error Then MsgBox(0x30, @ScriptName, 'Failed RunAs') ElseIf $CMDLINE[1] = '/restart' Then ShellExecute('"' & @ScriptDir & '\Ninite.exe"') If @error Then MsgBox(0x30, @ScriptName, 'Failed to execute "' & @ScriptDir & '\Ninite.exe"') Exit 1 EndIf ; While 1 If Not ProcessExists('Ninite.exe') Then Exit 1 WinSetTrans ( "Preparing", "", 0 ) WinWait("[REGEXPCLASS:Ninite.*]") $hNinite_Wnd = WinGetHandle("[REGEXPCLASS:Ninite.*]") _BlockInputEx(1, "", "", $hNinite_Wnd) $text = WinGetText("Ninite", "") If StringInStr($text, "Finished.",1) Then ExitLoop _BlockInputEx(0, "", "", $hNinite_Wnd) EndIf Sleep(500) WEnd Sleep(1000) ControlClick("Ninite", "", "[ID:2]") Else MsgBox(0x30, @ScriptName, 'Only /restart parameter is accepted') EndIf Edited November 20, 2013 by Jorin Link to comment Share on other sites More sharing options...
Jorin Posted November 25, 2013 Share Posted November 25, 2013 I just copied Example #1 (hWindows usage): from the first post. When I change _BlockInputEx(3, "", "", $hNotepad_Wnd) to _BlockInputEx(1, "", "", $hNotepad_Wnd) I noticed that it is not only blocking the notepad input. But is blocking all input for everything. I removed AdlibRegister("_Quit", 10000) and I ended up resetting the VM because mouse and keyboard where blocked Link to comment Share on other sites More sharing options...
Jorin Posted November 26, 2013 Share Posted November 26, 2013 Any help would be really appriciated 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