From 206140ee1e7800f9176eea32c5c0396f33c5365d Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Wed, 17 Dec 2025 09:27:49 +0100 Subject: [PATCH] Separate forwards and cycle into 2 keys --- EVE-X-Preview.json | 3 ++- src/Main_Class.ahk | 18 +++++++++--------- src/Propertys.ahk | 2 +- src/Settings_Gui.ahk | 12 ++++++++++++ 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/EVE-X-Preview.json b/EVE-X-Preview.json index 384115a..e84e274 100644 --- a/EVE-X-Preview.json +++ b/EVE-X-Preview.json @@ -55,13 +55,14 @@ "Daves":{ "AutoForwardOnKeypress":1, "AutoForwardToggle":0, + "AutoForwardToggleHotkey":"SC029", "BackwardsHotkey":"", "Characters":[ "PhatPhuckDave", "Primorium", "Secundamen" ], - "ForwardsHotkey":"SC029" + "ForwardsHotkey":"Tab" } }, "Hotkeys":[ diff --git a/src/Main_Class.ahk b/src/Main_Class.ahk index 93f880e..edea090 100644 --- a/src/Main_Class.ahk +++ b/src/Main_Class.ahk @@ -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" ) } } } diff --git a/src/Propertys.ahk b/src/Propertys.ahk index 58f147b..023c080 100644 --- a/src/Propertys.ahk +++ b/src/Propertys.ahk @@ -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?] { diff --git a/src/Settings_Gui.ahk b/src/Settings_Gui.ahk index 35e9688..81ca0df 100644 --- a/src/Settings_Gui.ahk +++ b/src/Settings_Gui.ahk @@ -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) }