Exit Posted September 5, 2014 Share Posted September 5, 2014 (edited) When using ASC notation in HotKeySet() for lower case letters, the corresponding function is NOT fired. Send() function accepts those values. While ProcessClose("notepad.exe") WEnd ShellExecute("notepad.exe") WinWait("[CLASS:Notepad]", "", 9) Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 0) Send("When using ASC notation in HotKeySet() for lower case letters, " & @CRLF) Send("the corresponding function is NOT fired. " & @CRLF) Send("Send() function accepts those values:" & @CRLF) Send("Now sending {{}ASC 0x0041{}} ==> {ASC 0x0041} " & @CRLF) Send("Now sending {{}ASC 0x0061{}} ==> {ASC 0x0061} " & @CRLF) Send("Press ESC to Exit." & @CRLF) Send("Please enter lower and upper case a/A ==> ") If Not HotKeySet("{ESC}", "_ESC") Then Exit MsgBox(Default, Default, "Hotkey ESC not set") Func _ESC() While ProcessClose("notepad.exe") WEnd Exit MsgBox(64 + 262144, Default, "ESC pressed. OK to Exit", 3) EndFunc ;==>_ESC If Not HotKeySet("{ASC 0x0041}", "_x41") Then Exit MsgBox(Default, Default, "Hotkey A(x41) not set") Func _x41() MsgBox(64 + 262144, Default, "Hotkey A(x41) pressed", 1) EndFunc ;==>_x41 If Not HotKeySet("{ASC 0x0061}", "_x61") Then Exit MsgBox(Default, Default, "Hotkey a(x61) not set") Func _x61() MsgBox(64 + 262144, Default, "Hotkey a(x61) pressed", 1) EndFunc ;==>_x61 While Sleep(100) WEnd HotKeySet() help says: Same format as Send(). Feature or bug ? Any comments ? Edited September 5, 2014 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
BrewManNH Posted September 6, 2014 Share Posted September 6, 2014 I'm guessing that the ASC part doesn't work in HotKeySet, because you can use it to Send characters that aren't on your keyboard, so you can't set a hotkey to a key that doesn't exist. Looks like a documentation issue rather than a bug. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Exit Posted September 6, 2014 Author Share Posted September 6, 2014 I'm guessing that the ASC part doesn't work in HotKeySet, because you can use it to Send characters that aren't on your keyboard, so you can't set a hotkey to a key that doesn't exist. Looks like a documentation issue rather than a bug. But the lower case 'a' is definitely on my keyboard. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 6, 2014 Moderators Share Posted September 6, 2014 Exit,You need to use Chr to set the HotKey, not Asc: HotKeySet(Chr(0x0061), "_Function") ; Lower case a While 1 Sleep(10) WEnd Func _Function() MsgBox(0, "Hi", "Pressed") EndFuncM23 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...
Exit Posted September 6, 2014 Author Share Posted September 6, 2014 You need to use Chr to set the HotKey, not Asc: Melba, I'm aware of the standard notation: hotkeyset("a","_Func") and its derivations.I'm dealing with the special notation ("{ASC ....}")I want to know, why {ASC 0x0041} is working and {ASC 0x0061} is failing to fire the function.Both return 1 from the Hotkeyset(). See my sample is post #1. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 6, 2014 Moderators Share Posted September 6, 2014 Exit,As mentioned in the Help file, setting HotKeys with uppercase is not a good idea so I am not at all surprised that {ASC 0x0061} fails to fire a HotKey set with {ASC 0x0041}. It certainly does not work when you use the standard letters:HotKeySet("A", "_Func") While 1 Sleep(10) WEnd Func _Func() MsgBox(0, "Hi", "Pressed") EndFuncFor me that fires on "A" but not on "a". So why would it be different when you define the letter using {ASC 0x####}? 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...
Exit Posted September 6, 2014 Author Share Posted September 6, 2014 As mentioned in the Help file, setting HotKeys with uppercase is not a good idea so I am not at all surprised that {ASC 0x0061} fails to fire.... Melba,{ASC 0x0061} is lowercase 'a'. Please run my script in post #1 and see the result. Uppercase fires and lowercase not. Strange? App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 6, 2014 Moderators Share Posted September 6, 2014 Exit.Not at all strange because you get exactly the same result when you use the actual letters - as shown by my snippet above. 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...
trancexx Posted September 6, 2014 Share Posted September 6, 2014 Melba, I'm aware of the standard notation: hotkeyset("a","_Func") and its derivations.I'm dealing with the special notation ("{ASC ....}")I want to know, why {ASC 0x0041} is working and {ASC 0x0061} is failing to fire the function.Both return 1 from the Hotkeyset(). See my sample is post #1.Because it's a bug.Snippet from the other guy isn't relevant. When you use {ASC ...} with HotkeySet() then you will always register letter A regardless of the key specified. That's because "ASC" starts with letter "A".;... HotKeySet("{ASC 0x0042}", "Whatever") ; press A, which is not {ASC 0x0042} in any case Func Whatever() MsgBox(32 + 262144, Default, "What hotkey was pressed?", 3) EndFunc ;... czardas 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 6, 2014 Moderators Share Posted September 6, 2014 trancexx,Thank you for correctly analysing the problem. I have raised Trac ticket #2881 for it. 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...
trancexx Posted September 6, 2014 Share Posted September 6, 2014 Sure, np.Btw, the process is called "critical thinking". Try it sometimes.If nothing, your smilies will have more sense. DatMCEyeBall 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 6, 2014 Moderators Share Posted September 6, 2014 <sigh> M23 MikahS 1 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...
Bert Posted September 6, 2014 Share Posted September 6, 2014 Sure, np. Btw, the process is called "critical thinking". Try it sometimes. If nothing, your smilies will have more sense. That was uncalled for and very rude. Please do not do that again. Thank you. MikahS 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 8, 2014 Moderators Share Posted September 8, 2014 Exit,We have amended the documentation to explain that you cannot use the {ASC ####} notation with HotKeySet. In fact you never have been able to do so and you were the first to notice after all these years, so thanks. 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...
Exit Posted September 8, 2014 Author Share Posted September 8, 2014 Melba23, You are welcome. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
trancexx Posted September 8, 2014 Share Posted September 8, 2014 That is wrong. Valid but wrong. ♡♡♡ . eMyvnE 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