Separate forwards and cycle into 2 keys

This commit is contained in:
2025-12-17 09:27:49 +01:00
parent a17efe97e5
commit 206140ee1e
4 changed files with 24 additions and 11 deletions

View File

@@ -55,13 +55,14 @@
"Daves":{
"AutoForwardOnKeypress":1,
"AutoForwardToggle":0,
"AutoForwardToggleHotkey":"SC029",
"BackwardsHotkey":"",
"Characters":[
"PhatPhuckDave",
"Primorium",
"Secundamen"
],
"ForwardsHotkey":"SC029"
"ForwardsHotkey":"Tab"
}
},
"Hotkeys":[

View File

@@ -312,8 +312,8 @@
;If any EVE Window Exist and at least 1 character matches the the list from the group windows
if(This.Global_Hotkeys) {
; Only register normal forwards hotkey if auto-forward is NOT enabled
if( v["ForwardsHotkey"] != "" && !hasAutoForward) {
; ForwardsHotkey always does normal cycling
if( v["ForwardsHotkey"] != "" ) {
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
HotIf ObjBindMethod(This, "OnWinExist", Arr)
try {
@@ -336,8 +336,8 @@
}
;If any EVE Window is Active
else {
; Only register normal forwards hotkey if auto-forward is NOT enabled
if( v["ForwardsHotkey"] != "" && !hasAutoForward) {
; ForwardsHotkey always does normal cycling
if( v["ForwardsHotkey"] != "" ) {
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
HotIf ObjBindMethod(This, "OnWinActive", Arr)
try {
@@ -358,7 +358,7 @@
}
}
}
; Store auto-forward groups and register toggle hotkey
; Store auto-forward groups and register separate toggle hotkey
if (hasAutoForward) {
groupIdx := This.AutoForwardGroups.Length + 1
This.AutoForwardGroups.Push(v["Characters"])
@@ -366,18 +366,18 @@
This.AutoForwardVisited[groupIdx] := []
This.AutoForwardToggleMode[groupIdx] := v.Has("AutoForwardToggle") ? v["AutoForwardToggle"] : true
; Register the forwards hotkey as toggle
if (v["ForwardsHotkey"] != "") {
; Register separate AutoForwardToggleHotkey if set
if (v.Has("AutoForwardToggleHotkey") && v["AutoForwardToggleHotkey"] != "") {
if(This.Global_Hotkeys) {
HotIf ObjBindMethod(This, "OnWinExist", v["Characters"])
} else {
HotIf ObjBindMethod(This, "OnWinActive", v["Characters"])
}
try {
Hotkey(v["ForwardsHotkey"], ObjBindMethod(This, "ToggleAutoForward", groupIdx, v["Characters"]), "P1")
Hotkey(v["AutoForwardToggleHotkey"], ObjBindMethod(This, "ToggleAutoForward", groupIdx, v["Characters"]), "P1")
}
catch ValueError as e {
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " - Hotkey Groups - " k " - Forwards Hotkey (Toggle)" )
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " - Hotkey Groups - " k " - Auto-Forward Toggle Hotkey" )
}
}
}

View File

@@ -415,7 +415,7 @@ class Propertys extends TrayMenu {
return This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"]
}
set {
This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"][Key] := Map("Characters", value, "ForwardsHotkey", "", "BackwardsHotkey", "", "AutoForwardOnKeypress", 0, "AutoForwardToggle", 1)
This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"][Key] := Map("Characters", value, "ForwardsHotkey", "", "BackwardsHotkey", "", "AutoForwardOnKeypress", 0, "AutoForwardToggle", 1, "AutoForwardToggleHotkey", "")
}
}
; Hotkey_Groups_Hotkeys[Name?, Hotkey?] {

View File

@@ -421,6 +421,11 @@
Hotkey_Groups.Push AutoForwardToggleCB
This.S_Gui["AutoForwardToggle"].OnEvent("Click", (obj, *) => SaveAutoForwardToggle(obj))
Hotkey_Groups.Push This.S_Gui.Add("Text", "xp yp+25", "Auto-Forward Toggle Hotkey:")
HKAutoForwardToggle := This.S_Gui.Add("Edit", "xp yp+20 w150 Disabled vAutoForwardToggleHotkey")
Hotkey_Groups.Push HKAutoForwardToggle
This.S_Gui["AutoForwardToggleHotkey"].OnEvent("Change", (obj, *) => SaveHKGroupList(obj))
This.S_Gui.Controls.Profile_Settings.PsDDL["Hotkey Groups"] := Hotkey_Groups
for k, v in This.S_Gui.Controls.Profile_Settings.PsDDL["Hotkey Groups"]
v.Visible := 0
@@ -444,6 +449,7 @@
ForwardHKObj.Enabled := 1, BackwardHKObj.Enabled := 1, EditObj.Enabled := 1
AutoForwardCB.value := 0, AutoForwardCB.Enabled := 1
AutoForwardToggleCB.value := 1, AutoForwardToggleCB.Enabled := 1
HKAutoForwardToggle.value := "", HKAutoForwardToggle.Enabled := 1
ddlObj.Choose(ArrayIndex)
This.NeedRestart := 1
SetTimer(This.Save_Settings_Delay_Timer, -200)
@@ -459,6 +465,7 @@
ForwardHKObj.Enabled := 0, BackwardHKObj.Enabled := 0, EditObj.Enabled := 0
AutoForwardCB.value := 0, AutoForwardCB.Enabled := 0
AutoForwardToggleCB.value := 0, AutoForwardToggleCB.Enabled := 0
HKAutoForwardToggle.value := "", HKAutoForwardToggle.Enabled := 0
This.NeedRestart := 1
SetTimer(This.Save_Settings_Delay_Timer, -200)
@@ -477,6 +484,8 @@
AutoForwardCB.Enabled := 1
AutoForwardToggleCB.value := This.Hotkey_Groups[ddlObj.Text].Has("AutoForwardToggle") ? This.Hotkey_Groups[ddlObj.Text]["AutoForwardToggle"] : 1
AutoForwardToggleCB.Enabled := 1
HKAutoForwardToggle.value := This.Hotkey_Groups[ddlObj.Text].Has("AutoForwardToggleHotkey") ? This.Hotkey_Groups[ddlObj.Text]["AutoForwardToggleHotkey"] : ""
HKAutoForwardToggle.Enabled := 1
}
}
@@ -497,6 +506,9 @@
else if (obj.Name = "BackwardsdKey" && ddl.Text != "") {
This.Hotkey_Groups[ddl.Text]["BackwardsHotkey"] := Trim(obj.value, "`n ")
}
else if (obj.Name = "AutoForwardToggleHotkey" && ddl.Text != "") {
This.Hotkey_Groups[ddl.Text]["AutoForwardToggleHotkey"] := Trim(obj.value, "`n ")
}
This.NeedRestart := 1
SetTimer(This.Save_Settings_Delay_Timer, -200)
}