Belini Posted August 31, 2013 Posted August 31, 2013 HotKeySet only works with lowercase letters, why not work to use a capital letter? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
JohnOne Posted August 31, 2013 Posted August 31, 2013 (edited) It does work with upper case. EDIT: Well it does if you use SHIFT key to get UPPERCASE. I think you'd have to make a feature request to natively work with CAPSLOCK. Or code it yourself. Edited August 31, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
PhoenixXL Posted August 31, 2013 Posted August 31, 2013 (edited) Set HotKey for both the keys #include-once #include <WinAPIEx.au3> ;http://www.autoitscript.com/forum/topic/98712-winapiex-udf/ #include <Misc.au3> ;Check the following HotKeySet("A", "a") HotKeySet("a", "a") While Sleep(10) WEnd Func a() ConsoleWrite(GetCaps() & @CRLF) EndFunc ;==>a ;In the case you need the function. ;Returns True when either CAPS LOCK or SHIFT key is pressed, otherwise False Func GetCaps() Local $fCaps = _Winapi_GetKeyState(0x14) Local $fShift = _IsPressed("10") Return $fCaps <> $fShift EndFunc ;==>GetCaps ;Environment(Language:0409 Keyboard:000B0409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) I guess this case appears in x64, in x32 it worked with both uppercase and lower case Edited August 31, 2013 by PhoenixXL 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.
Belini Posted August 31, 2013 Author Posted August 31, 2013 Did not express myself well, why not work if set upper or lower case without using capsloock? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
JohnOne Posted August 31, 2013 Posted August 31, 2013 It does. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Belini Posted August 31, 2013 Author Posted August 31, 2013 Using only HotKeySet not work. HotKeySet("a", "a") HotKeySet("B", "b") While 1 Sleep(10) WEnd Func a() ConsoleWrite("'a' key pressed" & @CRLF) EndFunc ;==>a Func b() ConsoleWrite("'B' key pressed" & @CRLF) EndFunc ;==>b My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Belini Posted September 1, 2013 Author Posted September 1, 2013 It would be nice if it were accepted uppercase using the function HotKeySet native Autoit My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
JohnOne Posted September 1, 2013 Posted September 1, 2013 Are you saying you'd like 'A' and 'a' to be treated as the same hotkey? If not please explain yourself more clearly. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
FireFox Posted September 1, 2013 Posted September 1, 2013 Don't expect the HotKeySet function to be changed, do like this: HotKeySet("a", "a") HotKeySet("A", "a")
PhoenixXL Posted September 1, 2013 Posted September 1, 2013 This should clear any persisting doubts expandcollapse popup#include-once #include <WinAPIEx.au3> ;http://www.autoitscript.com/forum/topic/98712-winapiex-udf/ #include <Misc.au3> ;Check the following Func HotKeySet_Uppercase_Lowercase($s_Key, $s_Func = "") HotKeySet(StringLower($s_Key), $s_Func) If StringIsAlpha($s_Key) Then HotKeySet(StringUpper($s_Key), $s_Func) EndFunc HotKeySet_Uppercase_Lowercase("A", "Func_A") HotKeySet_Uppercase_Lowercase("b", "Func_B") While Sleep(10) WEnd Func Func_A() If GetCaps() Then ConsoleWrite("Capital ") ConsoleWrite("A Pressed" & @CRLF) EndFunc ;==>a Func Func_B() If GetCaps() Then ConsoleWrite("Capital ") ConsoleWrite("B Pressed" & @CRLF) EndFunc ;In the case you need the function. ;Returns True when either CAPS LOCK or SHIFT key is pressed, otherwise False Func GetCaps() Local $fCaps = _Winapi_GetKeyState(0x14) Local $fShift = _IsPressed("10") Return $fCaps <> $fShift EndFunc ;==>GetCaps ;Environment(Language:0409 Keyboard:000B0409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) Thanks to Yashied for WinAPIEx Regards 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.
Belini Posted September 1, 2013 Author Posted September 1, 2013 This way I can do well, my question is why using only HotkeySet not work with capital letters? It would be nice if it were already native Autoit accept maiúculas to create Hotkeys. HotKeySet("a", "Func_a") $key = StringLower("B") HotKeySet('{' & $key & '}', "Func_b") While Sleep(10) WEnd Func Func_a() ConsoleWrite(' "a" Pressed' & @CRLF) EndFunc ;==>Func_a Func Func_b() ConsoleWrite(' "B" Pressed' & @CRLF) EndFunc ;==> My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
JohnOne Posted September 1, 2013 Posted September 1, 2013 why using only HotkeySet not work with capital letters? Because it would be worse. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
PhoenixXL Posted September 1, 2013 Posted September 1, 2013 (edited) So, "WHY" is the question I figured out till now Now its a native function, what I can guess is the HotKeySet uses the function RegisterHotkey over the hidden Autoit Window {to retrieve its handle use WinGetHandle(AutoItWinGetTitle ( ))} And RegisterHotkey differentiates keystrokes when they are pressed w/Shift or w/o Shift using modifiers. Therefore it might be programmed in AutoIT to use the SHIFT modifier whenever an uppercase char is passed in the function HotKeySet. Regards Edited September 1, 2013 by PhoenixXL 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.
Belini Posted September 1, 2013 Author Posted September 1, 2013 @ PhoenixXL, thanks for the clarification. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
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