kcvinu Posted March 15, 2015 Share Posted March 15, 2015 @JohnOne, that problem vanished after a restart. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
bitingsock Posted June 7, 2015 Share Posted June 7, 2015 (edited) I am experiencing a very frustrating bug._HotKey_Assign(BitOR($CK_CONTROL, $VK_RETURN), 'popup')When I try to activate the hotkey using the right control key, my keyboard continues to behave as if the control key has been left down. If I press the left control key and release it fixes it until I use the hotkey again. Pressing the right control key at that time does not fix the problem; only if I press the left control key.If I activate the hotkey using the left control key the problem is not exhibited. Edited June 7, 2015 by bitingsock Link to comment Share on other sites More sharing options...
Yashied Posted June 7, 2015 Author Share Posted June 7, 2015 (edited) @bitingsockI can't reproduce this "bug".#Include <HotKey.au3> Global Const $VK_RETURN = 0x0D _HotKey_Assign(BitOR($CK_CONTROL, $VK_RETURN), 'Test') While 1 Sleep(10) WEnd Func Test() ConsoleWrite('OK' & @CRLF) EndFunc ;==>Test Edited June 7, 2015 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
bitingsock Posted June 7, 2015 Share Posted June 7, 2015 (edited) #RequireAdmin #include <HotKey_21b.au3> #include <vkConstants.au3> Opt("GuiOnEventMode", 1) $Form1 = GUICreate("Ventrilo Dictator", 530, 60, -1, -1, -1) GUICtrlCreateLabel("Set a comment", 3, 0, 530, 17) GUICtrlCreateLabel("Ctrl+Enter for popup mode", 400, 0, 150, 20) $Input1 = GUICtrlCreateInput("", 3, 20, 450, 21) $Button1 = GUICtrlCreateButton("Set", 460, 20, 30, 21) _HotKey_Assign(BitOR($CK_CONTROL, $VK_RETURN), 'popup') $Button2 = GUICtrlCreateButton("clear", 490, 20, 30, 21) GUISetState(@SW_SHOW, $Form1) $tts = "" $previouswindow = 0 ControlFocus("Ventrilo Dictator", "", $Input1) While 1 Sleep(30) WEnd Func popup() If WinGetHandle("[active]") = $Form1 Then If $previouswindow <> 0 Then WinActivate($previouswindow) Else $previouswindow = WinGetHandle("[active]") WinActivate("Ventrilo Dictator") WinSetOnTop($Form1, "", 1) ControlFocus("Ventrilo Dictator", "", $Input1) WinSetOnTop($Form1, "", 0) EndIf EndFuncHere is a slimmed down version of my project. I will note the problem is now cleared by pressing the right control key afterwards (sometimes, I think)Try to type something into the gui this creates and you may notice the problem? I am on Win8.1 x64 btw Edited June 7, 2015 by bitingsock Link to comment Share on other sites More sharing options...
bitingsock Posted June 7, 2015 Share Posted June 7, 2015 (edited) I've discovered if I put a sleep(1000) in between$previouswindow = WinGetHandle("[active]")andWinActivate("Ventrilo Dictator")it prevents the problem so this may be a higher level bug and not directly something with the UDF.EDIT:ya it looks like it has something to do with having the key down when switching windows; I changed my popup() toFunc popup() If WinGetHandle("[active]") = $Form1 Then If $previouswindow <> 0 Then While _IsPressed("11") or _IsPressed("0D") Sleep(10) WEnd WinActivate($previouswindow) EndIf Else $previouswindow = WinGetHandle("[active]") While _IsPressed("11") or _IsPressed("0D") Sleep(10) WEnd WinActivate($Form1) WinSetOnTop($Form1, "", 1) ControlFocus($Form1, "", $Input1) WinSetOnTop($Form1, "", 0) EndIf EndFuncseems to fix my problem Edited June 7, 2015 by bitingsock Link to comment Share on other sites More sharing options...
RedwookHighway Posted May 17, 2016 Share Posted May 17, 2016 I'm trying to run a simple test for this but I'm not getting anything. The script I came up with should make a beep sound play when ctrl v is pressed. Can anyone see any glaring issues with my code? It should also not interfere with the proper function for the past command. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include<HotKey_21b.au3> #include<vKConstants.au3> _HotKey_Assign(BitOr($VK_CONTROL, $VK_V), "HotTest", $HK_FLAG_NOBLOCKHOTKEY, 0) Func HotTest() Beep(1000, 500) EndFunc While 1 sleep(200) WEnd I am running this on a Windows 8.1 box. Link to comment Share on other sites More sharing options...
RedwookHighway Posted May 19, 2016 Share Posted May 19, 2016 Interesting thing when running my test script the w key now makes the beep sound. There must be something going on with the Virtual-Key Codes. I looked them up but they seem correct. Link to comment Share on other sites More sharing options...
therks Posted December 31, 2016 Share Posted December 31, 2016 So I see that @Yashied hasn't been active in a while, so I'm hoping someone else paying attention to this thread can help. I seem to be having a similar issue as @bitingsock above. If another window is granted focus immediately, then the script will not recognize that the key has been released and will block all other keys from being typed. See repro script here: ;~ #include <HotKey.au3> #include <HotKey_21b.au3> #include <vkConstants.au3> $hWnd = GUICreate('Issue Test', 400, 300) GUICtrlCreateInput('', 0, 0, 400, 20) GUICtrlCreateLabel('First, press the hotkey (Win+Space). Now, without pressing space or any control keys (Alt, Win, etc) try to type anything in the input field. ' & _ 'You should notice that nothing seems to happen, and in fact all normal keys are unresponsive across windows, UNLESS you hit space or another control key.', 0, 30, 400, 100) _HotKey_Assign(BitOR($CK_WIN, $VK_SPACE), '_Test') GUISetState() Do Until GUIGetMsg() = -3 Func _Test() ;~ __HK_KeyUp($VK_SPACE) ; Uncomment to fix WinActivate($hWnd) EndFunc This seems to be because __HK_KeyUp() is not being called properly. I assume because it should be called on the WM_KEYUP or WM_SYSKEYUP message, and the monitoring window is not receiving that message because a different window is active when the key is released. I tried looking through the code to figure out where I could maybe force a check but I'm very lost. At best I could put it in the HK_WM_HOTKEY() function but I'm not sure how to get the right VK code to that function without hard coding it. Zoldex 1 My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Zoldex Posted February 24, 2017 Share Posted February 24, 2017 I'm experiencing the very same problem: CTRL key keeps "hooked" and I need to press it alone to let it unlock. Anyways I'm having the problem also with original HotKeySet function... Hope someone can help... Link to comment Share on other sites More sharing options...
Developers Jos Posted February 24, 2017 Developers Share Posted February 24, 2017 https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script.3F nobbitry, Zoldex and Guy_ 3 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...
Zoldex Posted February 24, 2017 Share Posted February 24, 2017 16 minutes ago, Jos said: https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script.3F Thanks mate! You saved my day! Link to comment Share on other sites More sharing options...
Mbee Posted January 12, 2018 Share Posted January 12, 2018 (edited) Never mind (I deleted my question) Edited January 12, 2018 by Mbee Wrong question Link to comment Share on other sites More sharing options...
x_bennY Posted April 19, 2018 Share Posted April 19, 2018 Hey, i'm having a big problem here... when i press a lot of keys in the same time the keys stops working! i can't type anything into my application. _HotKey_Assign(BitOR($CK_ALT, $VK_F11), "HotKeyPressed_Raw", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL, $HK_FLAG_NOBLOCKHOTKEY)) _HotKey_Assign($VK_RETURN, "HotKeyPressed_Raw", BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL, $HK_FLAG_NOBLOCKHOTKEY)) Link to comment Share on other sites More sharing options...
Deye Posted April 19, 2018 Share Posted April 19, 2018 x_bennY, Maybe you want to "_HotKey_Disable \ Enable" at the calling function's enter \ exit times I never used this UDF before.. , Please note that your reproducer doesn't tell us much as to how .. Or why this happening there, it isn't a complete reproducer .. x_bennY 1 Link to comment Share on other sites More sharing options...
Maran23 Posted August 23, 2018 Share Posted August 23, 2018 (edited) Hey, I have a little question. I want to make a Hotkey, that calls function, that is checking with "_IsPressed" method, if the user is holding down the key. With the normal HotKey UDF it worked. But with this, the key gets released when I press the Hotkey. When I use "$HK_FLAG_NOBLOCKHOTKEY" it works, but then my keys will also get written down. Someone has suggestions? Code: _HotKey_Assign($keyLeft, "left", $HK_FLAG_NOBLOCKHOTKEY + $HK_FLAG_NOOVERLAPCALL) ... Func left() MouseDown("left") While (_IsPressed($keyLeft, $dll)) Sleep(20) WEnd MouseUp("left") EndFunc ;==>left So I want to click with a key on my keyboard, but I also want to drag with it, thats why I use "_IsPressed". The User can customize the keys and I save the keycode in an ini, thats why this UDF is pretty useful, but I can't detect whether the user is still holding down the key. Edited August 23, 2018 by Maran23 Link to comment Share on other sites More sharing options...
legend Posted November 15, 2018 Share Posted November 15, 2018 what is the variable for the ALT key called in vkConstants.au3? Link to comment Share on other sites More sharing options...
ibecko Posted January 20, 2023 Share Posted January 20, 2023 (edited) what about Opt('SendCapslockMode', 0) and Send() ? without SendCapslockMode I have more problems (slow press Send command/Caps Lock blinking etc...) with SendCapslockMode not but this UDF not working as expected when I using Send() or when I wanna hotkey with SHIFT #include 'WinAPIGdi.au3' #Include '..\HotKeyUDF\HotKey_21b.au3' Opt('SendCapslockMode', 0) $_SHIFT = '0x0100' $_CTRL = '0x0200' $_ALT = '0x0400' $_WIN = '0x0800' $E = '0x45' $R = '0x52' _HotKey_Assign($_ALT + $E, "E", 4) _HotKey_Assign($_ALT + $R, "R", 4) while True sleep(10) wend Func E() ConsoleWrite("E") Send("E") sleep(200) EndFunc Func R() ConsoleWrite("R") sleep(200) EndFunc when I hold down ALT+R then write R into console as expected but when I hold down ALT+E function run only one, I must release ALT when I wanna run ALT+E again... can anyone help? Edited February 13, 2023 by ibecko 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