monoscout999 Posted May 11, 2011 Share Posted May 11, 2011 (edited) This is only a useful array const that might be useful to make a hotkey selector for some aplications.. expandcollapse popupglobal $keys[119][2] = [ _ ["01", "Left mouse button"], _ ["02", "Right mouse button"], _ ["04", "Middle mouse button (three-button mouse)"], _ ["05", "Windows 2000/XP: X1 mouse button"], _ ["06", "Windows 2000/XP: X2 mouse button"], _ ["08", "BACKSPACE key"], _ ["09", "TAB key"], _ ["0C", "CLEAR key"], _ ["0D", "ENTER key"], _ ["10", "SHIFT key"], _ ["11", "CTRL key"], _ ["12", "ALT key"], _ ["13", "PAUSE key"], _ ["14", "CAPS LOCK key"], _ ["1B", "ESC key"], _ ["20", "SPACEBAR"], _ ["21", "PAGE UP key"], _ ["22", "PAGE DOWN key"], _ ["23", "END key"], _ ["24", "HOME key"], _ ["25", "LEFT ARROW key"], _ ["26", "UP ARROW key"], _ ["27", "RIGHT ARROW key"], _ ["28", "DOWN ARROW key"], _ ["29", "SELECT key"], _ ["2A", "PRINT key"], _ ["2B", "EXECUTE key"], _ ["2C", "PRINT SCREEN key"], _ ["2D", "INS key"], _ ["2E", "DEL key"], _ ["30", "0 key"], _ ["31", "1 key"], _ ["32", "2 key"], _ ["33", "3 key"], _ ["34", "4 key"], _ ["35", "5 key"], _ ["36", "6 key"], _ ["37", "7 key"], _ ["38", "8 key"], _ ["39", "9 key"], _ ["41", "A key"], _ ["42", "B key"], _ ["43", "C key"], _ ["44", "D key"], _ ["45", "E key"], _ ["46", "F key"], _ ["47", "G key"], _ ["48", "H key"], _ ["49", "I key"], _ ["4A", "J key"], _ ["4B", "K key"], _ ["4C", "L key"], _ ["4D", "M key"], _ ["4E", "N key"], _ ["4F", "O key"], _ ["50", "P key"], _ ["51", "Q key"], _ ["52", "R key"], _ ["53", "S key"], _ ["54", "T key"], _ ["55", "U key"], _ ["56", "V key"], _ ["57", "W key"], _ ["58", "X key"], _ ["59", "Y key"], _ ["5A", "Z key"], _ ["5B", "Left Windows key"], _ ["5C", "Right Windows key"], _ ["60", "Numeric keypad 0 key"], _ ["61", "Numeric keypad 1 key"], _ ["62", "Numeric keypad 2 key"], _ ["63", "Numeric keypad 3 key"], _ ["64", "Numeric keypad 4 key"], _ ["65", "Numeric keypad 5 key"], _ ["66", "Numeric keypad 6 key"], _ ["67", "Numeric keypad 7 key"], _ ["68", "Numeric keypad 8 key"], _ ["69", "Numeric keypad 9 key"], _ ["6A", "Multiply key"], _ ["6B", "Add key"], _ ["6C", "Separator key"], _ ["6D", "Subtract key"], _ ["6E", "Decimal key"], _ ["6F", "Divide key"], _ ["70", "F1 key"], _ ["71", "F2 key"], _ ["72", "F3 key"], _ ["73", "F4 key"], _ ["74", "F5 key"], _ ["75", "F6 key"], _ ["76", "F7 key"], _ ["77", "F8 key"], _ ["78", "F9 key"], _ ["79", "F10 key"], _ ["7A", "F11 key"], _ ["7B", "F12 key"], _ ["7C", "F13 key"], _ ["7F", "F16 key"], _ ["80", "F17 key"], _ ["87", "F24 key"], _ ["90", "NUM LOCK key"], _ ["91", "SCROLL LOCK key"], _ ["A0", "Left SHIFT key"], _ ["A1", "Right SHIFT key"], _ ["A2", "Left CONTROL key"], _ ["A3", "Right CONTROL key"], _ ["A4", "Left MENU key"], _ ["A5", "Right MENU key"], _ ["BA", ";"], _ ["BB", "="], _ ["BC", ","], _ ["BD", "-"], _ ["BE", "."], _ ["BF", "/"], _ ["C0", "`"], _ ["DB", "["], _ ["DC", "\"], _ ["DD", "]"]] And here is a HotKey selectot for example.. expandcollapse popup#include <winapiex.au3> #include <StaticConstants.au3> #include <Misc.au3> global $keys[119][2] = [ _ ["01", "Left mouse button"], _ ["02", "Right mouse button"], _ ["04", "Middle mouse button (three-button mouse)"], _ ["05", "Windows 2000/XP: X1 mouse button"], _ ["06", "Windows 2000/XP: X2 mouse button"], _ ["08", "BACKSPACE key"], _ ["09", "TAB key"], _ ["0C", "CLEAR key"], _ ["0D", "ENTER key"], _ ["10", "SHIFT key"], _ ["11", "CTRL key"], _ ["12", "ALT key"], _ ["13", "PAUSE key"], _ ["14", "CAPS LOCK key"], _ ["1B", "ESC key"], _ ["20", "SPACEBAR"], _ ["21", "PAGE UP key"], _ ["22", "PAGE DOWN key"], _ ["23", "END key"], _ ["24", "HOME key"], _ ["25", "LEFT ARROW key"], _ ["26", "UP ARROW key"], _ ["27", "RIGHT ARROW key"], _ ["28", "DOWN ARROW key"], _ ["29", "SELECT key"], _ ["2A", "PRINT key"], _ ["2B", "EXECUTE key"], _ ["2C", "PRINT SCREEN key"], _ ["2D", "INS key"], _ ["2E", "DEL key"], _ ["30", "0 key"], _ ["31", "1 key"], _ ["32", "2 key"], _ ["33", "3 key"], _ ["34", "4 key"], _ ["35", "5 key"], _ ["36", "6 key"], _ ["37", "7 key"], _ ["38", "8 key"], _ ["39", "9 key"], _ ["41", "A key"], _ ["42", "B key"], _ ["43", "C key"], _ ["44", "D key"], _ ["45", "E key"], _ ["46", "F key"], _ ["47", "G key"], _ ["48", "H key"], _ ["49", "I key"], _ ["4A", "J key"], _ ["4B", "K key"], _ ["4C", "L key"], _ ["4D", "M key"], _ ["4E", "N key"], _ ["4F", "O key"], _ ["50", "P key"], _ ["51", "Q key"], _ ["52", "R key"], _ ["53", "S key"], _ ["54", "T key"], _ ["55", "U key"], _ ["56", "V key"], _ ["57", "W key"], _ ["58", "X key"], _ ["59", "Y key"], _ ["5A", "Z key"], _ ["5B", "Left Windows key"], _ ["5C", "Right Windows key"], _ ["60", "Numeric keypad 0 key"], _ ["61", "Numeric keypad 1 key"], _ ["62", "Numeric keypad 2 key"], _ ["63", "Numeric keypad 3 key"], _ ["64", "Numeric keypad 4 key"], _ ["65", "Numeric keypad 5 key"], _ ["66", "Numeric keypad 6 key"], _ ["67", "Numeric keypad 7 key"], _ ["68", "Numeric keypad 8 key"], _ ["69", "Numeric keypad 9 key"], _ ["6A", "Multiply key"], _ ["6B", "Add key"], _ ["6C", "Separator key"], _ ["6D", "Subtract key"], _ ["6E", "Decimal key"], _ ["6F", "Divide key"], _ ["70", "F1 key"], _ ["71", "F2 key"], _ ["72", "F3 key"], _ ["73", "F4 key"], _ ["74", "F5 key"], _ ["75", "F6 key"], _ ["76", "F7 key"], _ ["77", "F8 key"], _ ["78", "F9 key"], _ ["79", "F10 key"], _ ["7A", "F11 key"], _ ["7B", "F12 key"], _ ["7C", "F13 key"], _ ["7F", "F16 key"], _ ["80", "F17 key"], _ ["87", "F24 key"], _ ["90", "NUM LOCK key"], _ ["91", "SCROLL LOCK key"], _ ["A0", "Left SHIFT key"], _ ["A1", "Right SHIFT key"], _ ["A2", "Left CONTROL key"], _ ["A3", "Right CONTROL key"], _ ["A4", "Left MENU key"], _ ["A5", "Right MENU key"], _ ["BA", ";"], _ ["BB", "="], _ ["BC", ","], _ ["BD", "-"], _ ["BE", "."], _ ["BF", "/"], _ ["C0", "`"], _ ["DB", "["], _ ["DC", "\"], _ ["DD", "]"]] local $defkey = false, $key1, $key2 $GUI = Guicreate("HotKey selector test") $button1 = Guictrlcreatebutton("Chose HotKeys",50,50,200,50) $label2 = Guictrlcreatelabel("",20,160,170,150, $SS_CENTER) $label3 = Guictrlcreatelabel("",220,160,170,150, $SS_CENTER) guisetstate(@SW_SHOW,$GUI) While 1 $gmsj = Guigetmsg() switch $gmsj case -3 Exit case $button1 _ChoseHotKey() endswitch If $defkey = true Then If _ispressed(hex($key1)) then _BkBlue() If _ispressed(hex($key2)) then _BkRed() Endif WEnd Func _BkBlue() sleep(500) Guisetbkcolor(0x0000ff) EndFunc Func _BkRed() sleep(500) Guisetbkcolor(0xff0000) EndFunc Func _ChoseHotKey() $KeyGui = GUICreate("HOTKEY SELECTOR!", 250, 100, -1, -1, $DS_MODALFRAME) $label1 = GUICtrlCreateLabel("HOTKEY FOR BLUE BACKGROUND", 25, 25, 200, 50, $SS_CENTER) GUISetState() Do $key1 = _WinAPI_IsPressed(0x10, 0xFF) Until $key1 > 0x10 GUICtrlSetData($label1, "WAIT...") for $i = 0 to Ubound($keys)-1 If stringright(hex($key1),2) =$keys[$i][0] Then GUICtrlSetData($label2,"THE HOTKEY FOR BLUE BACKGROUND IS..."&$keys[$i][1]) EndIf Next Sleep(1000) GUICtrlSetData($label1, "HOTKEY FOR RED BACKGROUND") Do $key2 = _WinAPI_IsPressed(0x10, 0xFF) Until $key2 > 0x10 GUICtrlSetData($label1, "WAIT...") for $i = 0 to Ubound($keys)-1 If stringright(hex($key2),2) = $keys[$i][0] Then GUICtrlSetData($label3,"THE HOTKEY FOR RED BACKGROUND IS..."&$keys[$i][1]) EndIf Next Sleep(1000) If $key1 = $key2 Then MsgBox(0, "ERROR", "THE BLUE BK HOTKEY AND THE RED BK HOTKEY ARE THE SAME... TRY IT AGAIN") $Defkey = false GUIDelete($KeyGui) seterror (1) return $defkey Else $Defkey = true GUIDelete($KeyGui) Return $key1 And $key2 and $defkey EndIf EndFunc Edited May 11, 2011 by monoscout999 Link to comment Share on other sites More sharing options...
guinness Posted May 11, 2011 Share Posted May 11, 2011 I would probably edit your initial post to be a little different. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
monoscout999 Posted May 11, 2011 Author Share Posted May 11, 2011 I would probably edit your initial post to be a little different.Please if you found any error share it and i correct the first post... Link to comment Share on other sites More sharing options...
guinness Posted May 11, 2011 Share Posted May 11, 2011 I was referring to the introduction of your code. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
monoscout999 Posted May 11, 2011 Author Share Posted May 11, 2011 I was referring to the introduction of your code.done Link to comment Share on other sites More sharing options...
Mat Posted May 12, 2011 Share Posted May 12, 2011 Hey monoscout I'm not sure if you've realised, but the first column is in fact just hex values. You could have a single array of strings, and the first column is just hex(index). That would make everything a lot simpler and faster. AutoIt Project Listing Link to comment Share on other sites More sharing options...
monoscout999 Posted May 12, 2011 Author Share Posted May 12, 2011 Hey monoscout I'm not sure if you've realised, but the first column is in fact just hex values. You could have a single array of strings, and the first column is just hex(index). That would make everything a lot simpler and faster.you say leave the firt column like an index in hex and the second columd the text with the name of the key?The _ispressed function uses a string and not an hex number i guess.. in the examples always is _ispressed("35") and NOT _ispressed(35) it works in bout ways but i think is a little faster leave the type that is gonna use.... but please tell me more about what you are saying.. i´m not write/read very well in english... :S i speak native spanish Link to comment Share on other sites More sharing options...
Mat Posted May 12, 2011 Share Posted May 12, 2011 _IsPressed does need a string, but the Hex function returns a string, so you could do this: Hex(53, 2) to get the hex string. To get the index of the item with hex 'XX' use: $aArray[Dec('XX')] To get the hex of item n use: Hex(n, 2) Those two will replace the need for the first column. If I had time I'd write a better example but I've got cricket practice now... Maybe tomorrow when I have the day off school. AutoIt Project Listing 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