Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

HotKey!


  • Please log in to reply
11 replies to this topic

#1 iTwIx

iTwIx

    Seeker

  • Active Members
  • 6 posts

Posted 28 April 2012 - 11:16 AM

hey guys, a friend of mine needs help with hotkeys.

this is his script:

Plain Text         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 112, 40, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 112, 64, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 112, 88, 97, 17) $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 112, 112, 97, 17) $Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 112, 136, 97, 17) $Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 112, 160, 97, 17) $Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 112, 184, 97, 17) $Label1 = GUICtrlCreateLabel("Hot Key Ctrl+1", 8, 16, 72, 17) $Label2 = GUICtrlCreateLabel("Hot Key Ctrl+2", 8, 40, 72, 17) $Label3 = GUICtrlCreateLabel("Hot Key Ctrl+3", 8, 64, 72, 17) $Label4 = GUICtrlCreateLabel("Hot Key Ctrl+4", 8, 88, 72, 17) $Label5 = GUICtrlCreateLabel("Hot Key Ctrl+5", 8, 112, 72, 17) $Label6 = GUICtrlCreateLabel("Hot Key Ctrl+6", 8, 136, 72, 17) $Label7 = GUICtrlCreateLabel("Hot Key Ctrl+7", 8, 160, 72, 17) $Label8 = GUICtrlCreateLabel("Hot Key Ctrl+8", 8, 184, 72, 17) $Label9 = GUICtrlCreateLabel("Hot Key For Open and Close Alt+1", 8, 208, 165, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd


he said that when he presses any hotkey it dsnt works...







#2 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,892 posts

Posted 28 April 2012 - 11:19 AM

iTwIx,

Welcome to the Autoit forum. :)

And why does your friend think his HotKeys will work if he does not use HotKeySet at some point in the script? ;)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#3 iTwIx

iTwIx

    Seeker

  • Active Members
  • 6 posts

Posted 28 April 2012 - 11:24 AM

yh xD he only wrote hotkey in the label.... xD i was kinda ;) but he was keeping asking me to do it...

btw thnx for the welcome =)

#4 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,892 posts

Posted 28 April 2012 - 11:27 AM

iTwIx,

And so what is the question that you have? ;)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#5 iTwIx

iTwIx

    Seeker

  • Active Members
  • 6 posts

Posted 28 April 2012 - 11:30 AM

for now its all... thnx=)

#6 iTwIx

iTwIx

    Seeker

  • Active Members
  • 6 posts

Posted 28 April 2012 - 12:42 PM

how hes script is the following:

Plain Text         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{Alt}"); That For Closs And Open the From #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 112, 40, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 112, 64, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 112, 88, 97, 17) $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 112, 112, 97, 17) $Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 112, 136, 97, 17) $Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 112, 160, 97, 17) $Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 112, 184, 97, 17) $Label1 = GUICtrlCreateLabel("HotKeySet 1", 8, 16, 72, 17) $Label2 = GUICtrlCreateLabel("HotKeySet 2", 8, 40, 72, 17) $Label3 = GUICtrlCreateLabel("HotKeySet 3", 8, 64, 72, 17) $Label4 = GUICtrlCreateLabel("HotKeySet 4", 8, 88, 72, 17) $Label5 = GUICtrlCreateLabel("HotKeySet 5", 8, 112, 72, 17) $Label6 = GUICtrlCreateLabel("HotKeySet 6", 8, 136, 72, 17) $Label7 = GUICtrlCreateLabel("HotKeySet 7", 8, 160, 72, 17) $Label8 = GUICtrlCreateLabel("HotKeySet 8", 8, 184, 72, 17) $Label9 = GUICtrlCreateLabel("Hot Key For Open and Close Alt", 8, 208, 165, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 HotKeySet("{1}")("") Case $Checkbox2 HotKeySet("{2}")("") Case $Checkbox3 HotKeySet("{3}")("") Case $Checkbox4 HotKeySet("{4}")("") Case $Checkbox5 HotKeySet("{5}")("") Case $Checkbox6 HotKeySet("{6}")("") Case $Checkbox7 HotKeySet("{7}")("") Case $Checkbox8 HotKeySet("{8}")("") EndSwitch WEnd


but it still dsnt work

#7 guinness

guinness

    I've a handle on the fiction

  • Developers
  • 15,711 posts

Posted 28 April 2012 - 12:48 PM

You have to assign a function to HotKeySet and it's incorrectly formatted too. Refer to the Help file about HotKeySet.

Edited by guinness, 28 April 2012 - 12:48 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_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()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_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_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasswordValidPasteBinPosts Per DayPreExpandQueue()SciTE JumpSHELLHOOKShunting-YardSignature CreatorStack()StringAddLF()/StringStripLF()StringEOLToCRLF()WM_COPYDATAMore Examples...
Updated: 12/04/2014


#8 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,892 posts

Posted 28 April 2012 - 12:52 PM

iTwIx,

And why should it? Does your friend look at the Help file before coding or does he expect AutoIt to guess what he wants? ;)

The syntax for HotKeySet should be:
HotKeySet( HotKey, "Function_Name")

So where is the "Function_Name" (and the function itself? :)

M23

P.S. And you do not need the { } either. :D
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#9 iTwIx

iTwIx

    Seeker

  • Active Members
  • 6 posts

Posted 28 April 2012 - 08:04 PM

ok this is what my friend replayed me in another website:

See That i make it

Plain Text         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{z}", "Selectoncheckbox1") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 EndSwitch WEnd Func Selectoncheckbox1()     MsgBox(4096, "", "This is a message.") EndFunc   ;==>ShowMessage

but i went change MsgBox(4096, "", "This is a message.") to Select on checkbox1 not MsgBox(4096, "", "Select on checkbox1")
went change to select on checkbox1 no went it MsgBox Posted Image

sorry bro i dont understand what have u said...
ok that it

Plain Text         
[/size][/font][/color] #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{z}", "Selectoncheckbox1") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Checkbox1 EndSwitch WEnd Func Selectoncheckbox1()     MsgBox(4096, "", "00000000000") ; i went change Msgbox to  i dont know what need to change MsgBox to ...... to make (HotKeySet) can Select On Checkbox1 EndFunc

(write it and GM will know what i mean
[font=Verdana, Arial, Helvetica, sans-serif][size=3]i went change Msgbox to i dont know what need to change MsgBox to ...... to make (HotKeySet) can Select On Checkbox1)


[color=Red][font=Verdana, Arial, Helvetica, sans-serif][size=3](I am very sorry for bothering you)

Edited by iTwIx, 28 April 2012 - 08:08 PM.


#10 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 19,892 posts

Posted 28 April 2012 - 08:16 PM

iTwIx,

I have absolutely no idea what you are trying to do. ;)

The first script you have posted shows the HotKey being set (although you do not need the { } as I have already mentioned) but what on earth do you mean by?

to make (HotKeySet) can Select On Checkbox1

The HotKey runs the function that you tell it to run - in this case Selectoncheckbox1. If you want the function to run when you select the checkbox then you need to do something like this:
AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Checkbox1             Selectoncheckbox1()     EndSwitch WEnd Func Selectoncheckbox1()     MsgBox(4096, "", "00000000000") EndFunc   ;==>Selectoncheckbox1

Perhaps you need to get your friend to post here explaining what is going on rather than giving you snippets of script which only confuse us all. :)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#11 iTwIx

iTwIx

    Seeker

  • Active Members
  • 6 posts

Posted 28 April 2012 - 10:12 PM

yh im confused too lol my friend doesnt speaks well english so... ;)

#12 SeaSky

SeaSky

    Seeker

  • New Members
  • 4 posts

Posted 01 May 2012 - 04:43 PM

iTwIx



i Will Help me i am Really Surprised for
Melba23 cant help you !

see will add 2 func Only that it
Func Selectoncheckbox() GUICtrlSetState($Checkbox1, $GUI_CHECKED) EndFunc Func Selectoncheckbox1() GUICtrlSetState($Checkbox1, $GUI_unchecked) EndFunc

will make 2 hotkeyset
if went all Script
Plain Text         
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{z}", "Selectoncheckbox") HotKeySet("{x}", "Selectoncheckbox1") #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("", 215, 235, 299, 218) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 112, 16, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg   Case $GUI_EVENT_CLOSE    Exit EndSwitch WEnd Func Selectoncheckbox() GUICtrlSetState($Checkbox1, $GUI_CHECKED) EndFunc Func Selectoncheckbox1() GUICtrlSetState($Checkbox1, $GUI_unchecked) EndFunc

if he went add more check box he will need add other to func but change name func and change name $Checkbox1 Depending on the name $Checkbox 1 and the name next func not any name HotKeySet("{x}", "Here name the next Func") so will add Func Here name The Next Func any name but Be necessary in HotKeySet i hope i help your Friend ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users