OwiDowiSpinn Posted April 1, 2010 Share Posted April 1, 2010 C:\Program Files\AutoIt3\Include\HotKeyInput.au3(115,66) : ERROR: Opt() called with illegal argument 1: "OnExitFunc" Global $OnHotKeyInputExit = Opt('OnExitFunc', 'OnHotKeyInputExit') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Include\HotKeyInput.au3(122,1) : ERROR: syntax error == ^ Link to comment Share on other sites More sharing options...
Yashied Posted April 1, 2010 Author Share Posted April 1, 2010 (edited) OKHotKeyInput.au3 Edited April 1, 2010 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...
OwiDowiSpinn Posted April 2, 2010 Share Posted April 2, 2010 Thanks Link to comment Share on other sites More sharing options...
Beege Posted April 4, 2010 Share Posted April 4, 2010 @Yashied, These Hotkey UDFs that you made are really great. Studying them has been very educational. Thank you very much for sharing. One change that I made is to the VK Array. Instead of having a third include file, I just tucked into a small stringsplit function. Global $VK = _VK_Array() Func _VK_Array() Local $sVK = 'None||||||||Backspace|Tab|||Clear|Enter||||||Pause|CapsLosk|||||||Esc|||||Spacebar|PgUp|PgDown|End|Home|' & _ 'Left|Up|Right|Down|Select|Print|Execute|PrtScr|Ins|Del|Help|0|1|2|3|4|5|6|7|8|9||||||||A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|' & _ 'P|Q|R|S|T|U|V|W|X|Y|Z|Win|Win|0x5D||Sleep|Num 0|Num 1|Num 2|Num 3|Num 4|Num 5|Num 6|Num 7|Num 8|Num 9|Num *|Num +|0x6C|' & _ 'Num -|Num .|Num /|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|||||||||NumLock|' & _ 'ScrollLock|||||||||||||||Shift|Shift|Ctrl|Ctrl|Alt|Alt|BrowserBack|BrowserForward|BrowserRefresh|BrowserStop|BrowserSearch|' & _ 'BrowserFavorites|BrowserStart|VolumeMute|VolumeDown|VolumeUp|NextTrack|PreviousTrack|StopMedia|Play|Mail|Media|0xB6|0xB7|||' & _ ';|+|,|-|.|/|~|||||||||||||||||||||||||||[|\|]|"|0xDF|||0xE2|||0xE5||0xE7|||||0xEC||||||||||0xF6|0xF7|0xF8|0xF9|0xFA|0xFB|0xFC|0xFD|0xFE|' Return StringSplit($sVK, '|', 2) EndFunc Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Yashied Posted April 5, 2010 Author Share Posted April 5, 2010 Yes, it is easier, but it was assumed that the user can change the names of keys. The array looks more clearly. 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...
m4tius Posted May 13, 2010 Share Posted May 13, 2010 I want to use it to write simple script to make hotkeys and I need LAlt, RAlt, LCtrl etc... and just it, without other keys. It is possible to change this script for this? Link to comment Share on other sites More sharing options...
Yashied Posted May 13, 2010 Author Share Posted May 13, 2010 (edited) I want to use it to write simple script to make hotkeys and I need LAlt, RAlt, LCtrl etc... and just it, without other keys. It is possible to change this script for this?No. Edited May 13, 2010 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...
Yashied Posted October 18, 2011 Author Share Posted October 18, 2011 The library has been updated. v1.3 Added compatibility with UAC elevated windows (Windows Vista+).Renamed _GUICtrlHotKey* to _GUICtrlHKI_*.vkArray.au3 integrated into the library. 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...
therms Posted December 12, 2011 Share Posted December 12, 2011 Thanks for this. I was on the verge of figuring out how to create this myself. Libraries are one of the greatest things about programming...no more recreating the wheel! Link to comment Share on other sites More sharing options...
therms Posted December 15, 2011 Share Posted December 15, 2011 How can I make it so that if the user clicks outside of the input control (but within the scripts GUI), the control stops trying to capture input? Link to comment Share on other sites More sharing options...
therms Posted March 9, 2012 Share Posted March 9, 2012 (edited) How can I make it so that if the user clicks outside of the input control (but within the scripts GUI), the control stops trying to capture input? This is what I did to "fix" this: I maintain an array of the coordinates of each hotkey input in the GUI, and for each mouse click in the GUI check to see if a hotkey input is focused, and if it is, and the click isn't within the coordinates of a hotkey input, I focus the "background" of the window. $ctrlID_main_unfocused = _WinAPI_GetDlgCtrlID(ControlGetHandle($title, "", ControlGetFocus($title))) Case $GUI_EVENT_PRIMARYDOWN $hotkeyIsFocused = _hotkey_isInputFocused() ; Unfocus hotkey input boxes if click outside of them If Not _hotkey_clickedIn($extendedMsg[3], $extendedMsg[4]) Then If $hotkeyIsFocused Then ControlFocus($hwndGUI_main, "", $ctrlID_main_unfocused) EndIf Else $inputHasFocus = False EndIf In other news: @Yashied: How does this work with non-English language keyboards? I don't have access to such a thing, but I'm wondering how this will work. I noticed this line... Global $hkVk = StringSplit('None||||||||Backspace|Tab|||Clear|Enter||||||Pause|CapsLosk|||||||Esc|||||Spacebar|PgUp|PgDown|End|Home|Left|Up|Right|Down|Select|Print|Execute|PrtScr|Ins|Del|Help|0|1|2|3|4|5|6|7|8|9||||||||A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|Win|Win|0x5D||Sleep|Num 0|Num 1|Num 2|Num 3|Num 4|Num 5|Num 6|Num 7|Num 8|Num 9|Num *|Num +|0x6C|Num -|Num .|Num /|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|||||||||NumLock|ScrollLock|||||||||||||||Shift|Shift|Ctrl|Ctrl|Alt|Alt|BrowserBack|BrowserForward|BrowserRefresh|BrowserStop|BrowserSearch|BrowserFavorites|BrowserStart|VolumeMute|VolumeDown|VolumeUp|NextTrack|PreviousTrack|StopMedia|Play|Mail|Media|0xB6|0xB7|||;|+|,|-|.|/|~|||||||||||||||||||||||||||[|\|]|"|0xDF|||0xE2|||0xE5||0xE7|||||0xEC||||||||||0xF6|0xF7|0xF8|0xF9|0xFA|0xFB|0xFC|0xFD|0xFE|', '|', 2) Which I assume is used to display the keys pressed. I'm not clear on how non-English keyboards map on to English stuff. Also, CapsLock is mispelled. Edited March 9, 2012 by therms Link to comment Share on other sites More sharing options...
Yashied Posted March 10, 2012 Author Share Posted March 10, 2012 Global $aKey[256] $aKey[0x00] = 'Пусто' $aKey[0x01] = '' $aKey[0x02] = '' $aKey[0x03] = '' $aKey[0x04] = '' $aKey[0x05] = '' $aKey[0x06] = '' $aKey[0x07] = '' $aKey[0x08] = 'Возврат' $aKey[0x09] = 'Табуляция' $aKey[0x0A] = '' $aKey[0x0B] = '' $aKey[0x0C] = '' $aKey[0x0D] = 'Ввод' ; etc. _KeyLoadName($aKey) 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...
therms Posted March 10, 2012 Share Posted March 10, 2012 Global $aKey[256] $aKey[0x00] = 'Пусто' $aKey[0x01] = '' $aKey[0x02] = '' $aKey[0x03] = '' $aKey[0x04] = '' $aKey[0x05] = '' $aKey[0x06] = '' $aKey[0x07] = '' $aKey[0x08] = 'Возврат' $aKey[0x09] = 'Табуляция' $aKey[0x0A] = '' $aKey[0x0B] = '' $aKey[0x0C] = '' $aKey[0x0D] = 'Ввод' ; etc. _KeyLoadName($aKey) Damn. I was hoping there was a way to get this info from Windows instead of me having to do manual translation for every language I wanted to support. Thanks for the info! Link to comment Share on other sites More sharing options...
Yashied Posted March 10, 2012 Author Share Posted March 10, 2012 You can play with the following. #Include <APIConstants.au3> #Include <WinAPIEx.au3> For $i = 0x00 To 0xFF ConsoleWrite(Hex($i, 2) & ' - ' & _WinAPI_GetKeyNameText(BitShift(_WinAPI_MapVirtualKey($i, $MAPVK_VK_TO_VSC), -16)) & @CR) Next 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...
therms Posted March 11, 2012 Share Posted March 11, 2012 You can play with the following. #Include <APIConstants.au3> #Include <WinAPIEx.au3> For $i = 0x00 To 0xFF ConsoleWrite(Hex($i, 2) & ' - ' & _WinAPI_GetKeyNameText(BitShift(_WinAPI_MapVirtualKey($i, $MAPVK_VK_TO_VSC), -16)) & @CR) Next You're my hero. I can get everything I need out of this. Thanks! Link to comment Share on other sites More sharing options...
Logman Posted April 1, 2012 Share Posted April 1, 2012 (edited) Yashied, your UDF is perfect as always, just very hard to read. I'm trying to change the output to controls for current keyboard layout. For example, if the user switches the keyboard to another language, then will not be able to identify defined shortcuts in the future: US KB (0x0409): Ctrl + 3 CS KB (0x0405): Ctrl + 3 (but Ctrl + š is correctly) For this case I tried to modify your UDF function with _WinAPI_GetKeyNameText($lParam) called via GUIRegisterMsg($WM_KEYDOWN, 'WM_KEYDOWN'), but I was unable to incorporate into your script and obtain the correct parameter ($lParam) for the translation of a key. So, Is there any way to get the correct keyname for any keyboard? This solution is useful, but only for the default KBLayout: You can play with the following. #Include <APIConstants.au3> #Include <WinAPIEx.au3> For $i = 0x00 To 0xFF ConsoleWrite(Hex($i, 2) & ' - ' & _WinAPI_GetKeyNameText(BitShift(_WinAPI_MapVirtualKey($i, $MAPVK_VK_TO_VSC), -16)) & @CR) Next Moreover, ability to translate keycode->name for current keyboard layout may be useful for parsing a reading stored shorcuts. Thanks for UDF and any tip Edited April 1, 2012 by Logman Link to comment Share on other sites More sharing options...
Logman Posted April 2, 2012 Share Posted April 2, 2012 (edited) No response? I try to rephrase the question...How do I get KeyNameText of virtual-key code for a specific (and installed) keyboard layout? I tried to search this forum, the MSDN library, but unfortunately I could not find a solution.The code below will return same result. Function __WinAPI_MapVirtualKeyEx does not accept the parameter $sKbLayout.The function alway returns only KeyNameText for default keyboard layout specified in Regional and language settings.; # Question: How do I get the correct name of the key for each keyboard layout? ; # Note: I know two parameters: Virtual codes & KB Layout ; # Note: Both types of keyboards have been installed (Win7 x64, Au3: 3.3.8.1) ; local $sCurrentKbLayout = hex(_WinAPI_GetKeyboardLayout(_WinAPI_GetForegroundWindow()),4) ; $VK_3 >> 0x33: (US keyboard = '3', CS keyboard = 'š') Const $VK_3 = 0x33 ; two types of keyboard layout Const $US_KbLayout = '0409' Const $CS_KbLayout = '0405' ConsoleWrite('KeyNameText(US KB): ' & __WinAPI_GetKeyNameText(BitShift(__WinAPI_MapVirtualKeyEx(hex($VK_3), $US_KbLayout), -16)) & @CR) ConsoleWrite('KeyNameText(CS KB): ' & __WinAPI_GetKeyNameText(BitShift(__WinAPI_MapVirtualKeyEx(hex($VK_3), $CS_KbLayout), -16)) & @CR) ; << same result Func __WinAPI_MapVirtualKeyEx($sHexKey, $sKbLayout) Local Const $MAPVK_VK_TO_VSC = 0 Local Const $MAPVK_VSC_TO_VK = 1 Local Const $MAPVK_VK_TO_CHAR = 2 Local Const $MAPVK_VSC_TO_VK_EX = 3 Local Const $MAPVK_VK_TO_VSC_EX = 4 Local $Ret = DllCall('user32.dll', 'long', 'MapVirtualKeyEx', 'int', '0x' & $sHexKey, 'int', $MAPVK_VK_TO_VSC, 'int', '0x' & $sKbLayout) Return $Ret[0] EndFunc ;==>_WinAPI_MapVirtualKeyEx Func __WinAPI_GetKeyNameText($lParam) Local $Ret = DllCall('user32.dll', 'int', 'GetKeyNameTextW', 'long', $lParam, 'wstr', '', 'int', 256) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, '') EndIf Return $Ret[2] EndFunc ;==>__WinAPI_GetKeyNameTextI'm really confused. Thanks for any guidance. Edited April 2, 2012 by Logman Link to comment Share on other sites More sharing options...
Yashied Posted April 3, 2012 Author Share Posted April 3, 2012 US KB (0x0409): Ctrl + 3 CS KB (0x0405): Ctrl + 3 (but Ctrl + š is correctly) 1. No, it's not correct. For the hotkeys you should always use the unshifted character values. 2. You are wrong to use the MapVirtualKeyEx() function. #Include <APIConstants.au3> #Include <WinAPIEx.au3> Global $US_KbLayout = _WinAPI_LoadKeyboardLayout(0x0409) Global $CS_KbLayout = _WinAPI_LoadKeyboardLayout(0x0405) For $i = 0 To 255 ConsoleWrite(ChrW(_WinAPI_MapVirtualKeyEx($i, $MAPVK_VK_TO_CHAR, $CS_KbLayout)) & @CR) Next Func _WinAPI_MapVirtualKeyEx($iCode, $iType, $hLocale = 0) Local $Ret = DllCall('user32.dll', 'uint', 'MapVirtualKeyExW', 'uint', $iCode, 'uint', $iType, 'uint_ptr', $hLocale) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_MapVirtualKeyEx 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...
Logman Posted April 3, 2012 Share Posted April 3, 2012 Yashied, I tried it and it works well! That's what I needed! You are King! Thanks a lot. Link to comment Share on other sites More sharing options...
Logman Posted July 31, 2012 Share Posted July 31, 2012 Yashied, I have a small problem with the function _GUICtrlHKI_GetHotKey, that returns the wrong value. I used an example from the first post in the following code where I try to change the shortcut key twice, but the second set returns wrong result. In the following example I am trying to change the hotkey shortcut from F12 to F11 and then back to F12. No change from F11 to F12. Where is the problem? Thanks expandcollapse popup#Include <APIConstants.au3> #Include <GUIConstantsEx.au3> #Include <HotKeyInput.au3> Local $iMyHotKey = 123 ; F12 ; F11 (122) ; F12 (123) $iMyHotKey = _changeHotKey($iMyHotKey) ; <<--- manually change from F12 to F11 then click to OK ConsoleWrite ('1: ' & $iMyHotKey & @LF) ; <<--- Correct (122) $iMyHotKey = _changeHotKey($iMyHotKey) ; <<--- manually change from F11 to F12 then click to OK ConsoleWrite ('2: ' & $iMyHotKey & @LF) ; <<--- WRONG! Still 122 instead of 123 $iMyHotKey = _changeHotKey($iMyHotKey) ; you can see wrong value... Exit Func _changeHotKey($iOldHK) Local $Form, $HKI1, $HKI2, $Button, $Text, $NewHK $Form = GUICreate('Test', 300, 160) GUISetFont(8.5, 400, 0, 'Tahoma', $Form) $HKI1 = _GUICtrlHKI_Create($iOldHK, 56, 55, 230, 20) ; <<---- OLD HotKey as default ; Lock CTRL-ALT-DEL for Hotkey Input control, but not for Windows _KeyLock(0x062E) GUICtrlCreateLabel('Hotkey1:', 10, 58, 44, 14) GUICtrlCreateLabel('Click on Input box and hold a combination of keys.' & @CR & 'Press OK to view the code.', 10, 10, 280, 28) $Button = GUICtrlCreateButton('OK', 110, 124, 80, 23) GUICtrlSetState(-1, BitOR($GUI_DEFBUTTON, $GUI_FOCUS)) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE $NewHK = -1 ExitLoop Case $Button $NewHK = _GUICtrlHKI_GetHotKey($HKI1) ; <<--- second call returns the wrong result ? ExitLoop EndSwitch WEnd GUIDelete ($Form) Return $NewHK EndFunc ; ==>> _changeHotKey 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