Hey Folks
As The Title Says , I Try To Make A 4 Drop Down List To Make A Custom Keystroke.
The Idea Is To Build Keystrokes With DDL And Run The Program In List 4 With Key Stroke That Selected in 3 DDLs.
Know It Could Be Easy If Some Of You Guys Shows Some Lights
Thanks Mates
Here Is An Image Example
Custom KeyStroke With Drop Down List Topic is solved
Re: Custom KeyStroke With Drop Down List
Try this:I hope that helps.
- attempt to customize keystrokes with hotkeys
- to cancel hotkeys, reload the script with F5
- DDL3 (letters) is not functional
Code: Select all
#NoEnv
#SingleInstance, Force
List := ["", "^", "+", "!"]
Gui, Add, DropDownList, xm w50 vDDL1 AltSubmit, None||Ctrl|Shift|Alt
Gui, Add, DropDownList, x+0 w50 vDDL2, 0||1|2|3|4|5|6|7
Gui, Add, DropDownList, x+0 w50 vDDL3, Aa||Bb|Cc|Dd|Ee|Ff|Gg|Hh
Gui, Add, DropDownList, x+0 w50 vDDL4, One||Two|Three|Four|Five|Six|Seven|Eight
Gui, Add, Button, xm w200, Submit this hotkey
Gui, Show
Return ; end of auto-execute section
GuiClose:
GuiEscape:
ExitApp
F5:: Reload
;-------------------------------------------------------------------------------
ButtonSubmitThisHotkey:
;-------------------------------------------------------------------------------
Gui, Submit, NoHide
KeyName := List[DDL1] DDL2
Hotkey, %KeyName%, %DDL4%
Return
One:
Two:
Three:
Four:
Five:
Six:
Seven:
Eight:
MsgBox, %A_ThisLabel%
Return
Re: Custom KeyStroke With Drop Down List
wolf_II wrote:Try this:
- attempt to customize keystrokes with hotkeys
- to cancel hotkeys, reload the script with F5
- DDL3 (letters) is not functional
I hope that helps.Code: Select all
#NoEnv #SingleInstance, Force List := ["", "^", "+", "!"] Gui, Add, DropDownList, xm w50 vDDL1 AltSubmit, None||Ctrl|Shift|Alt Gui, Add, DropDownList, x+0 w50 vDDL2, 0||1|2|3|4|5|6|7 Gui, Add, DropDownList, x+0 w50 vDDL3, Aa||Bb|Cc|Dd|Ee|Ff|Gg|Hh Gui, Add, DropDownList, x+0 w50 vDDL4, One||Two|Three|Four|Five|Six|Seven|Eight Gui, Add, Button, xm w200, Submit this hotkey Gui, Show Return ; end of auto-execute section GuiClose: GuiEscape: ExitApp F5:: Reload ;------------------------------------------------------------------------------- ButtonSubmitThisHotkey: ;------------------------------------------------------------------------------- Gui, Submit, NoHide KeyName := List[DDL1] DDL2 Hotkey, %KeyName%, %DDL4% Return One: Two: Three: Four: Five: Six: Seven: Eight: MsgBox, %A_ThisLabel% Return
Thanks You Wolf_II , Works Perfectly
So Is There Any Commands To Associate The DDL Number 3 , And One Thing Is There Any Chance To Save In An Text File So Gui Always Call That When I Launceh The Script?
Thanks In Advance
Re: Custom KeyStroke With Drop Down List
And One Thing , For Example , Where I Should Put The "Run" Command In Script Like One : Run, WinRAR.exe ,C:\Program Files\WinRAR\,
Re: Custom KeyStroke With Drop Down List
regarding DDL3: I have not yet worked much with hotkey combinations (done with &). This looks promising, but might be severely flawed.
Try this and hope for the best:I hope that helps.
Try this and hope for the best:
Code: Select all
#NoEnv
#SingleInstance, Force
List := ["", "^", "+", "!"]
Gui, Add, DropDownList, xm w50 vDDL1 AltSubmit, None||Ctrl|Shift|Alt
Gui, Add, DropDownList, x+0 w50 vDDL2, 0||1|2|3|4|5|6|7
Gui, Add, DropDownList, x+0 w50 vDDL3, Aa||Bb|Cc|Dd|Ee|Ff|Gg|Hh
Gui, Add, DropDownList, x+0 w50 vDDL4, One||Two|Three|Four|Five|Six|Seven|Eight
Gui, Add, Button, xm w200, Submit this hotkey
Gui, Show
Return ; end of auto-execute section
GuiClose:
GuiEscape:
ExitApp
F5:: Reload
;-------------------------------------------------------------------------------
ButtonSubmitThisHotkey:
;-------------------------------------------------------------------------------
Gui, Submit, NoHide
KeyName := List[DDL1] DDL2 " & " SubStr(DDL3, 2)
Hotkey, %KeyName%, %DDL4%
Return
One:
Two:
Three:
Four:
Five:
Six:
Seven:
Eight:
MsgBox, %A_ThisLabel%
Return
Re: Custom KeyStroke With Drop Down List
regarding WinRar: Try this:
I hope that helps. untested.
Code: Select all
One:
Run, WinRAR.exe, C:\Program Files\WinRAR\
Return
Two:
Three:
Four:
Five:
Six:
Seven:
Eight:
MsgBox, %A_ThisLabel%
Return
Re: Custom KeyStroke With Drop Down List
regarding Writing to a text file:
I recommend using IniWrite and IniRead.
I will prepare something for your needs and post again.
I recommend using IniWrite and IniRead.
I will prepare something for your needs and post again.
Last edited by wolf_II on 10 Sep 2018, 04:59, edited 1 time in total.
Re: Custom KeyStroke With Drop Down List
Excellent , Works Flawlessly Thanks A Ton
Re: Custom KeyStroke With Drop Down List
Thanks MAan , I've Some Examples To Store The Inputs In An INI Filewolf_II wrote:regarding Writing to a text file:
I recommend using IniWrite and IniRead.
Re: Custom KeyStroke With Drop Down List
Wow That Sounds Awesome , Much Appreciated Wolfwolf_II wrote:regarding Writing to a text file:
I recommend using IniWrite and IniRead.
I will prepare something for your needs and post again.
Re: Custom KeyStroke With Drop Down List
I need more info: how do you want to handle GuiClose? Should it exit the script? Currently it does, but with the fancy new Ini-stuff, it might be better not to do so.
Also: F5 to reload is a workaround, Do you want to keep it?
Progress so far: IniWrite included
Also: F5 to reload is a workaround, Do you want to keep it?
Progress so far: IniWrite included
Code: Select all
#NoEnv
#SingleInstance, Force
IniFile := A_ScriptDir "\config.ini"
List := ["", "^", "+", "!"]
Gui, Add, DropDownList, xm w50 vDDL1 AltSubmit, None||Ctrl|Shift|Alt
Gui, Add, DropDownList, x+0 w50 vDDL2, 0||1|2|3|4|5|6|7
Gui, Add, DropDownList, x+0 w50 vDDL3, Aa||Bb|Cc|Dd|Ee|Ff|Gg|Hh
Gui, Add, DropDownList, x+0 w50 vDDL4, One||Two|Three|Four|Five|Six|Seven|Eight
Gui, Add, Button, xm w200, Submit this hotkey
Gui, Show
Return ; end of auto-execute section
GuiClose:
ExitApp
;-------------------------------------------------------------------------------
ButtonSubmitThisHotkey:
;-------------------------------------------------------------------------------
Gui, Submit, NoHide
KeyName := List[DDL1] DDL2 " & " SubStr(DDL3, 2)
Hotkey, %KeyName%, %DDL4%
IniWrite, %DDL4%, %IniFile%, Hotkeys, %KeyName%
Return
Re: Custom KeyStroke With Drop Down List
I Find A Script Which Stores All Edit Box Contents In A Text File , When I Press Close , And Call It When I Open it Again.
Re: Custom KeyStroke With Drop Down List
I don't understand the meaning of this sentence. Is this related to the current topic "Custom KeyStroke With Drop Down List"Thenatan wrote:I Find A Script Which Stores All Edit Box Contents In A Text File , When I Press Close , And Call It When I Open it Again.
Re: Custom KeyStroke With Drop Down List
wolf_II wrote:I don't understand the meaning of this sentence. Is this related to the current topic "Custom KeyStroke With Drop Down List"Thenatan wrote:I Find A Script Which Stores All Edit Box Contents In A Text File , When I Press Close , And Call It When I Open it Again.
I Tried To Answer , Your Question , Sorry Mate , I Think I Mislead You .how do you want to handle GuiClose? Should it exit the script? Currently it does, but with the fancy new Ini-stuff, it might be better not to do so
I Tried To Say , I Find An Example Which Calls Those Stored Commands In A INI File , And Call Them Back.
It Stores Files Right When I Press GuiClose , And No Need To Do The Commands Again , Would BE Great If We Get ASame Script With This One.
For Example In DDl Boxes Last Time Show , Ctrl,0,1,One , When I Close The Gui It Still Show Same Thing
Re: Custom KeyStroke With Drop Down List Topic is solved
Try this:Maybe you can use it anyway.
- GuiClose saves current choices
- Script reads from INI at startup
- I had to start ignoring DDL3 again
- I need to study hotkey combinations with & first
- Sorry
- may contain more bugs
Code: Select all
#NoEnv
#SingleInstance, Force
; CONSTANT vars
IniFile := A_ScriptDir "\config.ini"
List_1 := {None: "", Ctrl: "^", Shift: "+", Alt: "!"}
Labels := {One: 1, Two: 2, Three: 3, Four: 4
, Five: 5, Six: 6, Seven: 7, Eight: 8}
; retrieve previous GUI content
IniRead, prev_Modifier, %IniFile%, GUI, Modifier, 1
IniRead, prev_Number, %IniFile%, GUI, Number, 1
IniRead, prev_Letter, %IniFile%, GUI, Letter, 1
IniRead, prev_Label, %IniFile%, GUI, Label, 1
; convert to numbers, needed for choosing myDDL
myModifier := {None: 1, Ctrl: 2, Shift: 3, Alt: 4} [prev_Modifier]
myNumber := prev_Number + 1
myLetter := Asc(SubStr(prev_Letter, 2)) - 96
myLabel := Labels[prev_Label]
; DDLs
Modifiers := "None|Ctrl|Shift|Alt"
Numbers := "0|1|2|3|4|5|6|7"
Letters := "Aa|Bb|Cc|Dd|Ee|Ff|Gg|Hh"
Labels := "One|Two|Three|Four|Five|Six|Seven|Eight"
; GUI
Gui, Add, DropDownList, xm w50 vDDL1 Choose%myModifier%, %Modifiers%
Gui, Add, DropDownList, x+0 w50 vDDL2 Choose%myNumber%, %Numbers%
Gui, Add, DropDownList, x+0 w50 vDDL3 Choose%myLetter%, %Letters%
Gui, Add, DropDownList, x+0 w50 vDDL4 Choose%myLabel%, %Labels%
Gui, Add, Button, xm w200, Submit this hotkey
Gui, Show
Return ; end of auto-execute section
;-------------------------------------------------------------------------------
GuiClose:
;-------------------------------------------------------------------------------
Gui, Submit
; store current choices for DDLs
IniWrite, %DDL1%, %IniFile%, GUI, Modifier
IniWrite, %DDL2%, %IniFile%, GUI, Number
IniWrite, %DDL3%, %IniFile%, GUI, Letter
IniWrite, %DDL4%, %IniFile%, GUI, Label
ExitApp
;-------------------------------------------------------------------------------
ButtonSubmitThisHotkey:
;-------------------------------------------------------------------------------
Gui, Submit, NoHide
KeyName := List_1[DDL1] DDL2 ;" & " SubStr(DDL3, 2)
Hotkey, %KeyName%, %DDL4%
IniWrite, %DDL4%, %IniFile%, Hotkeys, %KeyName%
Return
One:
Run, WinRAR.exe, C:\Program Files\WinRAR\
Return
Two:
Three:
Four:
Five:
Six:
Seven:
Eight:
MsgBox, %A_ThisLabel%
Return
Last edited by wolf_II on 10 Sep 2018, 07:34, edited 1 time in total.
Re: Custom KeyStroke With Drop Down List
Wolf_II Man i Really Appreciated Youre Rock
Re: Custom KeyStroke With Drop Down List
BugFix: first start needs different defaults. (no config.ini yet)
Code: Select all
; retrieve previous GUI content
IniRead, prev_Modifier, %IniFile%, GUI, Modifier, None
IniRead, prev_Number, %IniFile%, GUI, Number, 0
IniRead, prev_Letter, %IniFile%, GUI, Letter, Aa
IniRead, prev_Label, %IniFile%, GUI, Label, One
Re: Custom KeyStroke With Drop Down List
It looks to me like the combinations you want to set up are not possible.Custom Combinations wrote:
Modifiers: Unlike a normal hotkey, custom combinations act as though they have the wildcard (*) modifier by default. For example, 1 & 2:: will activate even if Ctrl or Alt is held down when 1 and 2 are pressed, whereas ^1:: would be activated only by Ctrl+1 and not Ctrl+Alt+1.
It previously seemed to work only because I tested with None as the modifier.
Re: Custom KeyStroke With Drop Down List
Yes Man , It Seems We Can't Use 3 Keystrokes In This Case , I'm Already Happy With The 2 Of Them
I Can't Say It Is A Real Bug , But After Reload The Script With Commands That Stored In Config File , Had to Press Submit Button To Activate The Hotkey That Made With Script Before , Should Be Awesome If We Pass The Press Button Again In Second Gui Launch
I Can't Say It Is A Real Bug , But After Reload The Script With Commands That Stored In Config File , Had to Press Submit Button To Activate The Hotkey That Made With Script Before , Should Be Awesome If We Pass The Press Button Again In Second Gui Launch
Re: Custom KeyStroke With Drop Down List
regarding hotkeys not active on script reload:
I will implement that after we settle which one of three keys you want to abandon.
You can choose Modifier+Number or Modifier+Letter => easy change.
You also can choose Number+Letter => also easy change, but combinations might still come back to bite us.
I just can't tell yet, should be OK. And you have a greater variety of hotkeys to choose from.
You're the boss, I'm all for Number+Letter using combinations.
I will implement that after we settle which one of three keys you want to abandon.
You can choose Modifier+Number or Modifier+Letter => easy change.
You also can choose Number+Letter => also easy change, but combinations might still come back to bite us.
I just can't tell yet, should be OK. And you have a greater variety of hotkeys to choose from.
You're the boss, I'm all for Number+Letter using combinations.
Who is online
Users browsing this forum: masterkomp, OrangeCat, ruespe, Spawnova, yuu453 and 391 guests