Compare commits
17 Commits
developmen
...
cyka
| Author | SHA1 | Date | |
|---|---|---|---|
| 701311f2b7 | |||
| 3c169c41ac | |||
| e2f42a399a | |||
| ec2a7aef70 | |||
| 7283fc975c | |||
| b29c1bed4f | |||
| 5d960e3882 | |||
| e95e619aac | |||
| 1c13e512c0 | |||
| a05ddb4c64 | |||
| 206140ee1e | |||
| a17efe97e5 | |||
| 1f77ab607a | |||
| 13456d92ac | |||
| a6b230d7da | |||
| 33bc259ab1 | |||
| 6c2022ca2b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
EVE-X-Preview.json
|
EVE-X-Preview.json
|
||||||
|
EVE-X-Preview.exe
|
||||||
|
|||||||
189
EVE-X-Preview.json
Normal file
189
EVE-X-Preview.json
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
{
|
||||||
|
"_Profiles":{
|
||||||
|
"Dave":{
|
||||||
|
"Client Possitions":{
|
||||||
|
"PhatPhuckDave":{
|
||||||
|
"IsMaximized":0,
|
||||||
|
"height":1440,
|
||||||
|
"width":2560,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"Primorium":{
|
||||||
|
"IsMaximized":0,
|
||||||
|
"height":1440,
|
||||||
|
"width":2560,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"Secundamen":{
|
||||||
|
"IsMaximized":0,
|
||||||
|
"height":1440,
|
||||||
|
"width":2560,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Client Settings":{
|
||||||
|
"AlwaysMaximize":0,
|
||||||
|
"Dont_Minimize_Clients":[
|
||||||
|
"Example Name1",
|
||||||
|
"Example Name2",
|
||||||
|
"Example Name3"
|
||||||
|
],
|
||||||
|
"MinimizeInactiveClients":0,
|
||||||
|
"TrackClientPossitions":1
|
||||||
|
},
|
||||||
|
"Custom Colors":{
|
||||||
|
"cColorActive":"0",
|
||||||
|
"cColors":{
|
||||||
|
"Bordercolor":[
|
||||||
|
"FFFFFF"
|
||||||
|
],
|
||||||
|
"CharNames":[
|
||||||
|
"Example Char"
|
||||||
|
],
|
||||||
|
"IABordercolor":[
|
||||||
|
"FFFFFF"
|
||||||
|
],
|
||||||
|
"TextColor":[
|
||||||
|
"FFFFFF"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Hotkey Groups":{
|
||||||
|
"Daves":{
|
||||||
|
"AutoForwardOnKeypress":1,
|
||||||
|
"AutoForwardToggle":1,
|
||||||
|
"AutoForwardToggleHotkey":"SC029",
|
||||||
|
"BackwardsHotkey":"+Tab",
|
||||||
|
"Characters":[
|
||||||
|
"PhatPhuckDave",
|
||||||
|
"Primorium",
|
||||||
|
"Secundamen"
|
||||||
|
],
|
||||||
|
"ForwardsHotkey":"Tab"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Hotkeys":[
|
||||||
|
{
|
||||||
|
"PhatPhuckDave":"lalt & 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Primorium":"lalt & 2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Secundamen":"lalt & 3"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Thumbnail Positions":{},
|
||||||
|
"Thumbnail Settings":{
|
||||||
|
"ClientHighligtBorderthickness":4,
|
||||||
|
"ClientHighligtColor":"#E36A0D",
|
||||||
|
"HideThumbnailsOnLostFocus":0,
|
||||||
|
"InactiveClientBorderColor":"#8A8A8A",
|
||||||
|
"InactiveClientBorderthickness":2,
|
||||||
|
"ShowAllColoredBorders":0,
|
||||||
|
"ShowClientHighlightBorder":1,
|
||||||
|
"ShowThumbnailTextOverlay":1,
|
||||||
|
"ShowThumbnailsAlwaysOnTop":1,
|
||||||
|
"ThumbnailOpacity":80,
|
||||||
|
"ThumbnailTextColor":"#FAC57A",
|
||||||
|
"ThumbnailTextFont":"Gill Sans MT",
|
||||||
|
"ThumbnailTextMargins":{
|
||||||
|
"x":15,
|
||||||
|
"y":5
|
||||||
|
},
|
||||||
|
"ThumbnailTextSize":12
|
||||||
|
},
|
||||||
|
"Thumbnail Visibility":{}
|
||||||
|
},
|
||||||
|
"Default":{
|
||||||
|
"Client Possitions":{},
|
||||||
|
"Client Settings":{
|
||||||
|
"AlwaysMaximize":0,
|
||||||
|
"Dont_Minimize_Clients":[
|
||||||
|
"Example Name1",
|
||||||
|
"Example Name2",
|
||||||
|
"Example Name3"
|
||||||
|
],
|
||||||
|
"MinimizeInactiveClients":0,
|
||||||
|
"TrackClientPossitions":0
|
||||||
|
},
|
||||||
|
"Custom Colors":{
|
||||||
|
"cColorActive":"0",
|
||||||
|
"cColors":{
|
||||||
|
"Bordercolor":[
|
||||||
|
"FFFFFF"
|
||||||
|
],
|
||||||
|
"CharNames":[
|
||||||
|
"Example Char"
|
||||||
|
],
|
||||||
|
"IABordercolor":[
|
||||||
|
"FFFFFF"
|
||||||
|
],
|
||||||
|
"TextColor":[
|
||||||
|
"FFFFFF"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Hotkey Groups":{},
|
||||||
|
"Hotkeys":[
|
||||||
|
{
|
||||||
|
"Example Name1":"1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Example Name2":"ctrl & 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Example Name3":"Xbutton1 & 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Example Name4":"^XButton1 & 1"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Thumbnail Positions":{},
|
||||||
|
"Thumbnail Settings":{
|
||||||
|
"ClientHighligtBorderthickness":4,
|
||||||
|
"ClientHighligtColor":"#E36A0D",
|
||||||
|
"HideThumbnailsOnLostFocus":0,
|
||||||
|
"InactiveClientBorderColor":"#8A8A8A",
|
||||||
|
"InactiveClientBorderthickness":2,
|
||||||
|
"ShowAllColoredBorders":0,
|
||||||
|
"ShowClientHighlightBorder":1,
|
||||||
|
"ShowThumbnailTextOverlay":1,
|
||||||
|
"ShowThumbnailsAlwaysOnTop":1,
|
||||||
|
"ThumbnailOpacity":80,
|
||||||
|
"ThumbnailTextColor":"#FAC57A",
|
||||||
|
"ThumbnailTextFont":"Gill Sans MT",
|
||||||
|
"ThumbnailTextMargins":{
|
||||||
|
"x":15,
|
||||||
|
"y":5
|
||||||
|
},
|
||||||
|
"ThumbnailTextSize":12
|
||||||
|
},
|
||||||
|
"Thumbnail Visibility":{}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"global_Settings":{
|
||||||
|
"CharScreenHotkey":"",
|
||||||
|
"DisableLiveThumbnail":1,
|
||||||
|
"Global_Hotkeys":1,
|
||||||
|
"LastUsedProfile":"Dave",
|
||||||
|
"Minimize_Delay":100,
|
||||||
|
"Suspend_Hotkeys_Hotkey":"",
|
||||||
|
"ThumbnailBackgroundColor":"#57504E",
|
||||||
|
"ThumbnailMinimumSize":{
|
||||||
|
"height":50,
|
||||||
|
"width":50
|
||||||
|
},
|
||||||
|
"ThumbnailSnap":1,
|
||||||
|
"ThumbnailSnap_Distance":"20",
|
||||||
|
"ThumbnailStartLocation":{
|
||||||
|
"height":140,
|
||||||
|
"width":250,
|
||||||
|
"x":20,
|
||||||
|
"y":20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
|
Class Main_Class extends ThumbWindow {
|
||||||
|
|
||||||
Class Main_Class extends ThumbWindow {
|
|
||||||
Static WM_DESTROY := 0x02,
|
Static WM_DESTROY := 0x02,
|
||||||
WM_SIZE := 0x05,
|
WM_SIZE := 0x05,
|
||||||
WM_NCCALCSIZE := 0x83,
|
WM_NCCALCSIZE := 0x83,
|
||||||
@@ -40,6 +38,12 @@ Class Main_Class extends ThumbWindow {
|
|||||||
EventHooks := Map()
|
EventHooks := Map()
|
||||||
ThumbWindows := {}
|
ThumbWindows := {}
|
||||||
ThumbHwnd_EvEHwnd := Map()
|
ThumbHwnd_EvEHwnd := Map()
|
||||||
|
AutoForwardGroups := []
|
||||||
|
AutoForwardEnabled := Map() ; Map of group index => enabled state
|
||||||
|
AutoForwardVisited := Map() ; Map of group index => array of visited window names
|
||||||
|
AutoForwardToggleMode := Map() ; Map of group index => toggle mode setting
|
||||||
|
AutoForwardProcessedWindow := 0 ; Track which window hwnd already got its input processed
|
||||||
|
AutoForwardToggleVKCodes := [] ; Array of VK codes for toggle hotkeys
|
||||||
|
|
||||||
__New() {
|
__New() {
|
||||||
|
|
||||||
@@ -207,12 +211,13 @@ Class Main_Class extends ThumbWindow {
|
|||||||
static registerGroups := 0
|
static registerGroups := 0
|
||||||
;if the user has set Hotkeys in Options
|
;if the user has set Hotkeys in Options
|
||||||
if (This._Hotkeys[title]) {
|
if (This._Hotkeys[title]) {
|
||||||
|
hk := This._Hotkeys[title]
|
||||||
;if the user has selected Global Hotkey. This means the Hotkey will alsways trigger as long at least 1 EVE Window exist.
|
;if the user has selected Global Hotkey. This means the Hotkey will alsways trigger as long at least 1 EVE Window exist.
|
||||||
;if a Window does not Exist which was assigned to the hotkey the hotkey will be dissabled until the Window exist again
|
;if a Window does not Exist which was assigned to the hotkey the hotkey will be dissabled until the Window exist again
|
||||||
if(This.Global_Hotkeys) {
|
if(This.Global_Hotkeys) {
|
||||||
HotIf (*) => WinExist(This.EVEExe) && WinExist("EVE - " title ) && !WinActive("EVE-X-Preview - Settings")
|
HotIf (*) => WinExist(This.EVEExe) && WinExist("EVE - " title ) && !WinActive("EVE-X-Preview - Settings") && !This.HasExtraModifiers(hk)
|
||||||
try {
|
try {
|
||||||
Hotkey This._Hotkeys[title], (*) => This.ActivateEVEWindow(,,title), "P1"
|
Hotkey hk, (*) => This.ActivateEVEWindow(,,title), "P1"
|
||||||
}
|
}
|
||||||
catch ValueError as e {
|
catch ValueError as e {
|
||||||
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkeys" )
|
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkeys" )
|
||||||
@@ -221,9 +226,9 @@ Class Main_Class extends ThumbWindow {
|
|||||||
;if the user has selected (Win Active) the hotkeys will only trigger if at least 1 EVE Window is Active and in Focus
|
;if the user has selected (Win Active) the hotkeys will only trigger if at least 1 EVE Window is Active and in Focus
|
||||||
;This makes it possible to still use all keys outside from EVE
|
;This makes it possible to still use all keys outside from EVE
|
||||||
else {
|
else {
|
||||||
HotIf (*) => WinExist("EVE - " title ) && WinActive(This.EVEExe)
|
HotIf (*) => WinExist("EVE - " title ) && WinActive(This.EVEExe) && !This.HasExtraModifiers(hk)
|
||||||
try {
|
try {
|
||||||
Hotkey This._Hotkeys[title], (*) => This.ActivateEVEWindow(,,title),"P1"
|
Hotkey hk, (*) => This.ActivateEVEWindow(,,title),"P1"
|
||||||
}
|
}
|
||||||
catch ValueError as e {
|
catch ValueError as e {
|
||||||
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkeys" )
|
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkeys" )
|
||||||
@@ -232,6 +237,26 @@ Class Main_Class extends ThumbWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; Check if extra modifiers are pressed beyond what's in the hotkey string
|
||||||
|
HasExtraModifiers(hk) {
|
||||||
|
; Check which modifiers are in the hotkey
|
||||||
|
hasCtrl := InStr(hk, "^") || InStr(hk, "ctrl", false)
|
||||||
|
hasAlt := InStr(hk, "!") || InStr(hk, "alt", false)
|
||||||
|
hasShift := InStr(hk, "+") || InStr(hk, "shift", false)
|
||||||
|
hasWin := InStr(hk, "#") || InStr(hk, "win", false)
|
||||||
|
|
||||||
|
; Return true if any modifier is pressed that's NOT in the hotkey
|
||||||
|
if (!hasCtrl && GetKeyState("Ctrl", "P"))
|
||||||
|
return true
|
||||||
|
if (!hasAlt && GetKeyState("Alt", "P"))
|
||||||
|
return true
|
||||||
|
if (!hasShift && GetKeyState("Shift", "P"))
|
||||||
|
return true
|
||||||
|
if (!hasWin && (GetKeyState("LWin", "P") || GetKeyState("RWin", "P")))
|
||||||
|
return true
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
Register_CharSelectionScreen_Hotkeys(){
|
Register_CharSelectionScreen_Hotkeys(){
|
||||||
if (This.CharScreenHotkey != "" ) {
|
if (This.CharScreenHotkey != "" ) {
|
||||||
HotIf (*) => WinExist("ahk_exe " This.EVEExe)
|
HotIf (*) => WinExist("ahk_exe " This.EVEExe)
|
||||||
@@ -283,49 +308,218 @@ Class Main_Class extends ThumbWindow {
|
|||||||
static Fkey := "", BKey := "", Arr := []
|
static Fkey := "", BKey := "", Arr := []
|
||||||
if (IsObject(This.Hotkey_Groups) && This.Hotkey_Groups.Count != 0) {
|
if (IsObject(This.Hotkey_Groups) && This.Hotkey_Groups.Count != 0) {
|
||||||
for k, v in This.Hotkey_Groups {
|
for k, v in This.Hotkey_Groups {
|
||||||
;If any EVE Window Exist and at least 1 character matches the the list from the group windows
|
; Check if auto-forward is enabled for this group
|
||||||
|
hasAutoForward := v.Has("AutoForwardOnKeypress") && v["AutoForwardOnKeypress"]
|
||||||
|
|
||||||
|
; ForwardsHotkey and BackwardsHotkey only trigger when EVE window is active
|
||||||
|
if( v["ForwardsHotkey"] != "" ) {
|
||||||
|
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
|
||||||
|
HotIf ObjBindMethod(This, "OnWinActive", Arr)
|
||||||
|
try {
|
||||||
|
Hotkey( v["ForwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"ForwardsHotkey"), "P1")
|
||||||
|
}
|
||||||
|
catch ValueError as e {
|
||||||
|
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " - Hotkey Groups - " k " - Forwards Hotkey" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( v["BackwardsHotkey"] != "" ) {
|
||||||
|
Fkey := v["BackwardsHotkey"], Arr := v["Characters"]
|
||||||
|
HotIf ObjBindMethod(This, "OnWinActive", Arr)
|
||||||
|
try {
|
||||||
|
Hotkey( v["BackwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"BackwardsHotkey"), "P1")
|
||||||
|
}
|
||||||
|
catch ValueError as e {
|
||||||
|
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkey Groups - " k " - Backwards Hotkey" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
; Store auto-forward groups and register separate toggle hotkey
|
||||||
|
if (hasAutoForward) {
|
||||||
|
groupIdx := This.AutoForwardGroups.Length + 1
|
||||||
|
This.AutoForwardGroups.Push(v["Characters"])
|
||||||
|
This.AutoForwardEnabled[groupIdx] := false
|
||||||
|
This.AutoForwardVisited[groupIdx] := []
|
||||||
|
This.AutoForwardToggleMode[groupIdx] := v.Has("AutoForwardToggle") ? v["AutoForwardToggle"] : true
|
||||||
|
|
||||||
|
; Register separate AutoForwardToggleHotkey if set
|
||||||
|
if (v.Has("AutoForwardToggleHotkey") && v["AutoForwardToggleHotkey"] != "") {
|
||||||
|
toggleKey := v["AutoForwardToggleHotkey"]
|
||||||
|
vkCode := GetKeyVK(toggleKey)
|
||||||
|
if (vkCode) {
|
||||||
|
found := false
|
||||||
|
for code in This.AutoForwardToggleVKCodes {
|
||||||
|
if (code = vkCode) {
|
||||||
|
found := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
This.AutoForwardToggleVKCodes.Push(vkCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
if(This.Global_Hotkeys) {
|
if(This.Global_Hotkeys) {
|
||||||
if( v["ForwardsHotkey"] != "" ) {
|
HotIf ObjBindMethod(This, "OnWinExist", v["Characters"])
|
||||||
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
|
} else {
|
||||||
HotIf ObjBindMethod(This, "OnWinExist", Arr)
|
HotIf ObjBindMethod(This, "OnWinActive", v["Characters"])
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Hotkey( v["ForwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"ForwardsHotkey"), "P1")
|
Hotkey(toggleKey, ObjBindMethod(This, "ToggleAutoForward", groupIdx, v["Characters"]), "P1")
|
||||||
}
|
}
|
||||||
catch ValueError as e {
|
catch ValueError as e {
|
||||||
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " - Hotkey Groups - " k " - Forwards Hotkey" )
|
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " - Hotkey Groups - " k " - Auto-Forward Toggle Hotkey" )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( v["BackwardsHotkey"] != "" ) {
|
}
|
||||||
Fkey := v["BackwardsHotkey"], Arr := v["Characters"]
|
}
|
||||||
HotIf ObjBindMethod(This, "OnWinExist", Arr)
|
}
|
||||||
|
; Register keyboard/mouse hook if any auto-forward groups exist
|
||||||
|
if (This.AutoForwardGroups.Length > 0) {
|
||||||
|
This.RegisterAutoForwardHook()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
; Toggle auto-forward for a group
|
||||||
|
ToggleAutoForward(groupIdx, Arr, *) {
|
||||||
|
if (This.AutoForwardEnabled[groupIdx]) {
|
||||||
|
; Disable
|
||||||
|
This.AutoForwardEnabled[groupIdx] := false
|
||||||
|
This.AutoForwardVisited[groupIdx] := []
|
||||||
|
} else {
|
||||||
|
; Enable and mark current window as first visited
|
||||||
|
This.AutoForwardEnabled[groupIdx] := true
|
||||||
|
This.AutoForwardVisited[groupIdx] := []
|
||||||
|
This.AutoForwardProcessedWindow := 0 ; Reset so current window can receive input
|
||||||
try {
|
try {
|
||||||
Hotkey( v["BackwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"BackwardsHotkey"), "P1")
|
ActiveTitle := This.CleanTitle(WinGetTitle("A"))
|
||||||
}
|
This.AutoForwardVisited[groupIdx].Push(ActiveTitle)
|
||||||
catch ValueError as e {
|
|
||||||
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkey Groups - " k " - Backwards Hotkey" )
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;If any EVE Window is Active
|
|
||||||
else {
|
; Register a low-level input hook for auto-forward
|
||||||
if( v["ForwardsHotkey"] != "" ) {
|
RegisterAutoForwardHook() {
|
||||||
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
|
; Use low-level keyboard hook to catch ALL keys including with modifiers
|
||||||
HotIf ObjBindMethod(This, "OnWinActive", Arr)
|
This.KeyboardHook := DllCall("SetWindowsHookEx", "Int", 13, "Ptr", CallbackCreate(ObjBindMethod(This, "LowLevelKeyboardProc"), "Fast", 3), "Ptr", 0, "UInt", 0, "Ptr")
|
||||||
|
; Use low-level mouse hook
|
||||||
|
This.MouseHook := DllCall("SetWindowsHookEx", "Int", 14, "Ptr", CallbackCreate(ObjBindMethod(This, "LowLevelMouseProc"), "Fast", 3), "Ptr", 0, "UInt", 0, "Ptr")
|
||||||
|
}
|
||||||
|
|
||||||
|
; Low-level mouse hook callback
|
||||||
|
LowLevelMouseProc(nCode, wParam, lParam) {
|
||||||
|
static WM_LBUTTONUP := 0x202, WM_RBUTTONUP := 0x205, WM_MBUTTONUP := 0x208
|
||||||
|
|
||||||
|
; Use mouse UP so the click registers in the window first
|
||||||
|
if (nCode >= 0 && (wParam = WM_LBUTTONUP || wParam = WM_RBUTTONUP || wParam = WM_MBUTTONUP)) {
|
||||||
|
if (This.IsAutoForwardActive()) {
|
||||||
try {
|
try {
|
||||||
Hotkey( v["ForwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"ForwardsHotkey"), "P1")
|
currentWindow := WinGetID("A")
|
||||||
}
|
; Only process if this window hasn't been processed yet
|
||||||
catch ValueError as e {
|
if (currentWindow != This.AutoForwardProcessedWindow) {
|
||||||
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " - Hotkey Groups - " k " - Forwards Hotkey" )
|
This.AutoForwardProcessedWindow := currentWindow
|
||||||
|
; Must defer out of hook context
|
||||||
|
SetTimer(ObjBindMethod(This, "TriggerAutoForward"), -1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( v["BackwardsHotkey"] != "" ) {
|
}
|
||||||
Fkey := v["BackwardsHotkey"], Arr := v["Characters"]
|
}
|
||||||
HotIf ObjBindMethod(This, "OnWinActive", Arr)
|
return DllCall("CallNextHookEx", "Ptr", 0, "Int", nCode, "Ptr", wParam, "Ptr", lParam)
|
||||||
|
}
|
||||||
|
|
||||||
|
; Low-level keyboard hook callback
|
||||||
|
LowLevelKeyboardProc(nCode, wParam, lParam) {
|
||||||
|
static WM_KEYUP := 0x0101, WM_SYSKEYUP := 0x0105
|
||||||
|
|
||||||
|
if (nCode >= 0 && (wParam = WM_KEYUP || wParam = WM_SYSKEYUP)) {
|
||||||
|
vkCode := NumGet(lParam, 0, "UInt")
|
||||||
|
; Ignore modifier keys themselves
|
||||||
|
if (vkCode = 0x10 || vkCode = 0x11 || vkCode = 0x12
|
||||||
|
|| vkCode = 0x5B || vkCode = 0x5C
|
||||||
|
|| vkCode = 0xA0 || vkCode = 0xA1 || vkCode = 0xA2
|
||||||
|
|| vkCode = 0xA3 || vkCode = 0xA4 || vkCode = 0xA5) {
|
||||||
|
return DllCall("CallNextHookEx", "Ptr", 0, "Int", nCode, "Ptr", wParam, "Ptr", lParam)
|
||||||
|
}
|
||||||
|
|
||||||
|
; Ignore toggle hotkeys
|
||||||
|
for code in This.AutoForwardToggleVKCodes {
|
||||||
|
if (code = vkCode) {
|
||||||
|
return DllCall("CallNextHookEx", "Ptr", 0, "Int", nCode, "Ptr", wParam, "Ptr", lParam)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (This.IsAutoForwardActive()) {
|
||||||
try {
|
try {
|
||||||
Hotkey( v["BackwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"BackwardsHotkey"), "P1")
|
currentWindow := WinGetID("A")
|
||||||
|
; Only process if this window hasn't been processed yet
|
||||||
|
if (currentWindow != This.AutoForwardProcessedWindow) {
|
||||||
|
This.AutoForwardProcessedWindow := currentWindow
|
||||||
|
; Must defer out of hook context - SetTimer -1 runs immediately after hook returns
|
||||||
|
SetTimer(ObjBindMethod(This, "TriggerAutoForward"), -1)
|
||||||
}
|
}
|
||||||
catch ValueError as e {
|
}
|
||||||
MsgBox(e.Message ": --> " e.Extra " <-- in Profile Settings - " This.LastUsedProfile " Hotkey Groups - " k " - Backwards Hotkey" )
|
}
|
||||||
|
}
|
||||||
|
; Always pass to next hook
|
||||||
|
return DllCall("CallNextHookEx", "Ptr", 0, "Int", nCode, "Ptr", wParam, "Ptr", lParam)
|
||||||
|
}
|
||||||
|
|
||||||
|
; Check if any auto-forward group window is active AND enabled
|
||||||
|
IsAutoForwardActive() {
|
||||||
|
try {
|
||||||
|
ActiveTitle := This.CleanTitle(WinGetTitle("A"))
|
||||||
|
for groupIdx, Arr in This.AutoForwardGroups {
|
||||||
|
if (This.AutoForwardEnabled[groupIdx] && This.OnWinActive(Arr)) {
|
||||||
|
for index, name in Arr {
|
||||||
|
if (name = ActiveTitle)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
; Check if current window should auto-forward and trigger it
|
||||||
|
TriggerAutoForward() {
|
||||||
|
try {
|
||||||
|
ActiveTitle := This.CleanTitle(WinGetTitle("A"))
|
||||||
|
for groupIdx, Arr in This.AutoForwardGroups {
|
||||||
|
if (!This.AutoForwardEnabled[groupIdx])
|
||||||
|
continue
|
||||||
|
if (This.OnWinActive(Arr)) {
|
||||||
|
for index, name in Arr {
|
||||||
|
if (name = ActiveTitle) {
|
||||||
|
This.Cycle_Hotkey_Groups(Arr, "ForwardsHotkey")
|
||||||
|
|
||||||
|
; Update processed window to the NEW window after cycling
|
||||||
|
try This.AutoForwardProcessedWindow := WinGetID("A")
|
||||||
|
|
||||||
|
; Track visited window
|
||||||
|
try {
|
||||||
|
newTitle := This.CleanTitle(WinGetTitle("A"))
|
||||||
|
alreadyVisited := false
|
||||||
|
for visited in This.AutoForwardVisited[groupIdx] {
|
||||||
|
if (visited = newTitle) {
|
||||||
|
alreadyVisited := true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!alreadyVisited) {
|
||||||
|
This.AutoForwardVisited[groupIdx].Push(newTitle)
|
||||||
|
}
|
||||||
|
|
||||||
|
; If not toggle mode, check if all windows visited
|
||||||
|
if (!This.AutoForwardToggleMode[groupIdx]) {
|
||||||
|
existingCount := 0
|
||||||
|
for n in Arr {
|
||||||
|
if (WinExist("EVE - " n " Ahk_Exe exefile.exe"))
|
||||||
|
existingCount++
|
||||||
|
}
|
||||||
|
if (This.AutoForwardVisited[groupIdx].Length >= existingCount) {
|
||||||
|
This.AutoForwardEnabled[groupIdx] := false
|
||||||
|
This.AutoForwardVisited[groupIdx] := []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,7 +548,7 @@ Class Main_Class extends ThumbWindow {
|
|||||||
Index := 1
|
Index := 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
This.ActivateEVEWindow(,,This.CleanTitle(Arr[Index]))
|
This.ActivateEVEWindow(,,This.CleanTitle(Arr[Index]), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,7 +567,7 @@ Class Main_Class extends ThumbWindow {
|
|||||||
Index := length
|
Index := length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
This.ActivateEVEWindow(,,This.CleanTitle(Arr[Index]))
|
This.ActivateEVEWindow(,,This.CleanTitle(Arr[Index]), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,7 +739,7 @@ Class Main_Class extends ThumbWindow {
|
|||||||
;if a EVE Window got closed this destroyes the Thumbnail and frees the memory.
|
;if a EVE Window got closed this destroyes the Thumbnail and frees the memory.
|
||||||
EvEWindowDestroy(hwnd?, WinTitle?) {
|
EvEWindowDestroy(hwnd?, WinTitle?) {
|
||||||
if (IsSet(hwnd) && This.ThumbWindows.HasProp(hwnd)) {
|
if (IsSet(hwnd) && This.ThumbWindows.HasProp(hwnd)) {
|
||||||
for k, v in This.ThumbWindows.Clone().%hwnd% {
|
for k, v in This.ThumbWindows.%hwnd% {
|
||||||
if (K = "Thumbnail")
|
if (K = "Thumbnail")
|
||||||
continue
|
continue
|
||||||
v.Destroy()
|
v.Destroy()
|
||||||
@@ -555,12 +749,13 @@ Class Main_Class extends ThumbWindow {
|
|||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
;If a EVE Windows get destroyed
|
;If a EVE Windows get destroyed
|
||||||
for Win_Hwnd,v in This.ThumbWindows.Clone().OwnProps() {
|
for Win_Hwnd, v in This.ThumbWindows.Clone().OwnProps() {
|
||||||
if (!WinExist("Ahk_Id " Win_Hwnd)) {
|
if (!WinExist("Ahk_Id " Win_Hwnd)) {
|
||||||
for k,v in This.ThumbWindows.Clone().%Win_Hwnd% {
|
if (IsObject(v))
|
||||||
|
for k, guiObj in v {
|
||||||
if (K = "Thumbnail")
|
if (K = "Thumbnail")
|
||||||
continue
|
continue
|
||||||
v.Destroy()
|
guiObj.Destroy()
|
||||||
}
|
}
|
||||||
This.ThumbWindows.DeleteProp(Win_Hwnd)
|
This.ThumbWindows.DeleteProp(Win_Hwnd)
|
||||||
}
|
}
|
||||||
@@ -568,7 +763,15 @@ Class Main_Class extends ThumbWindow {
|
|||||||
This.DestroyThumbnailsToggle := 1
|
This.DestroyThumbnailsToggle := 1
|
||||||
}
|
}
|
||||||
|
|
||||||
ActivateEVEWindow(hwnd?,ThisHotkey?, title?) {
|
ActivateEVEWindow(hwnd?,ThisHotkey?, title?, fromAutoForward := false) {
|
||||||
|
; Disable all auto-forward groups (emergency shutoff) - but not when called from auto-forward itself
|
||||||
|
if (!fromAutoForward) {
|
||||||
|
for groupIdx in This.AutoForwardEnabled {
|
||||||
|
This.AutoForwardEnabled[groupIdx] := false
|
||||||
|
This.AutoForwardVisited[groupIdx] := []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
; If the user clicks the Thumbnail then hwnd stores the Thumbnail Hwnd. Here the Hwnd gets changed to the contiguous EVE window hwnd
|
; If the user clicks the Thumbnail then hwnd stores the Thumbnail Hwnd. Here the Hwnd gets changed to the contiguous EVE window hwnd
|
||||||
if (IsSet(hwnd) && This.ThumbHwnd_EvEHwnd.Has(hwnd)) {
|
if (IsSet(hwnd) && This.ThumbHwnd_EvEHwnd.Has(hwnd)) {
|
||||||
hwnd := WinExist(This.ThumbHwnd_EvEHwnd[hwnd])
|
hwnd := WinExist(This.ThumbHwnd_EvEHwnd[hwnd])
|
||||||
@@ -810,4 +1013,3 @@ Class Main_Class extends ThumbWindow {
|
|||||||
FileAppend(JSON.Dump(This._JSON, , " "), "EVE-X-Preview.json")
|
FileAppend(JSON.Dump(This._JSON, , " "), "EVE-X-Preview.json")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ class Propertys extends TrayMenu {
|
|||||||
return This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"]
|
return This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"]
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"][Key] := Map("Characters", value, "ForwardsHotkey", "", "BackwardsHotkey", "")
|
This._JSON["_Profiles"][This.LastUsedProfile]["Hotkey Groups"][Key] := Map("Characters", value, "ForwardsHotkey", "", "BackwardsHotkey", "", "AutoForwardOnKeypress", 0, "AutoForwardToggle", 1, "AutoForwardToggleHotkey", "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
; Hotkey_Groups_Hotkeys[Name?, Hotkey?] {
|
; Hotkey_Groups_Hotkeys[Name?, Hotkey?] {
|
||||||
|
|||||||
@@ -412,6 +412,20 @@
|
|||||||
Hotkey_Groups.Push HKBackwards
|
Hotkey_Groups.Push HKBackwards
|
||||||
This.S_Gui["BackwardsdKey"].OnEvent("Change", (obj, *) => SaveHKGroupList(obj))
|
This.S_Gui["BackwardsdKey"].OnEvent("Change", (obj, *) => SaveHKGroupList(obj))
|
||||||
|
|
||||||
|
Hotkey_Groups.Push This.S_Gui.Add("Text", "xp yp50", "Auto-Forward:")
|
||||||
|
AutoForwardCB := This.S_Gui.Add("Checkbox", "xp yp+20 Disabled vAutoForwardOnKeypress", "Forward on any keypress")
|
||||||
|
Hotkey_Groups.Push AutoForwardCB
|
||||||
|
This.S_Gui["AutoForwardOnKeypress"].OnEvent("Click", (obj, *) => SaveAutoForward(obj))
|
||||||
|
|
||||||
|
AutoForwardToggleCB := This.S_Gui.Add("Checkbox", "xp yp+20 Disabled vAutoForwardToggle", "Toggle mode (else: disable after full cycle)")
|
||||||
|
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
|
This.S_Gui.Controls.Profile_Settings.PsDDL["Hotkey Groups"] := Hotkey_Groups
|
||||||
for k, v in This.S_Gui.Controls.Profile_Settings.PsDDL["Hotkey Groups"]
|
for k, v in This.S_Gui.Controls.Profile_Settings.PsDDL["Hotkey Groups"]
|
||||||
v.Visible := 0
|
v.Visible := 0
|
||||||
@@ -433,6 +447,9 @@
|
|||||||
}
|
}
|
||||||
EditObj.value := "", ForwardHKObj.value := "", BackwardHKObj.value := ""
|
EditObj.value := "", ForwardHKObj.value := "", BackwardHKObj.value := ""
|
||||||
ForwardHKObj.Enabled := 1, BackwardHKObj.Enabled := 1, EditObj.Enabled := 1
|
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)
|
ddlObj.Choose(ArrayIndex)
|
||||||
This.NeedRestart := 1
|
This.NeedRestart := 1
|
||||||
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
||||||
@@ -446,6 +463,9 @@
|
|||||||
ddlObj.Add(This.GetGroupList())
|
ddlObj.Add(This.GetGroupList())
|
||||||
ForwardHKObj.value := "", BackwardHKObj.value := "", EditObj.value := ""
|
ForwardHKObj.value := "", BackwardHKObj.value := "", EditObj.value := ""
|
||||||
ForwardHKObj.Enabled := 0, BackwardHKObj.Enabled := 0, EditObj.Enabled := 0
|
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
|
This.NeedRestart := 1
|
||||||
|
|
||||||
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
||||||
@@ -460,6 +480,12 @@
|
|||||||
EditObj.value := text, EditObj.Enabled := 1
|
EditObj.value := text, EditObj.Enabled := 1
|
||||||
ForwardHKObj.value := This.Hotkey_Groups[ddlObj.Text]["ForwardsHotkey"], ForwardHKObj.Enabled := 1
|
ForwardHKObj.value := This.Hotkey_Groups[ddlObj.Text]["ForwardsHotkey"], ForwardHKObj.Enabled := 1
|
||||||
BackwardHKObj.value := This.Hotkey_Groups[ddlObj.Text]["BackwardsHotkey"], BackwardHKObj.Enabled := 1
|
BackwardHKObj.value := This.Hotkey_Groups[ddlObj.Text]["BackwardsHotkey"], BackwardHKObj.Enabled := 1
|
||||||
|
AutoForwardCB.value := This.Hotkey_Groups[ddlObj.Text].Has("AutoForwardOnKeypress") ? This.Hotkey_Groups[ddlObj.Text]["AutoForwardOnKeypress"] : 0
|
||||||
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,9 +506,28 @@
|
|||||||
else if (obj.Name = "BackwardsdKey" && ddl.Text != "") {
|
else if (obj.Name = "BackwardsdKey" && ddl.Text != "") {
|
||||||
This.Hotkey_Groups[ddl.Text]["BackwardsHotkey"] := Trim(obj.value, "`n ")
|
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
|
This.NeedRestart := 1
|
||||||
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SaveAutoForward(obj) {
|
||||||
|
if (ddl.Text != "") {
|
||||||
|
This.Hotkey_Groups[ddl.Text]["AutoForwardOnKeypress"] := obj.value
|
||||||
|
This.NeedRestart := 1
|
||||||
|
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveAutoForwardToggle(obj) {
|
||||||
|
if (ddl.Text != "") {
|
||||||
|
This.Hotkey_Groups[ddl.Text]["AutoForwardToggle"] := obj.value
|
||||||
|
This.NeedRestart := 1
|
||||||
|
SetTimer(This.Save_Settings_Delay_Timer, -200)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Class TrayMenu extends Settings_Gui {
|
|||||||
TrayMenu.Add("Reload", (*) => Reload())
|
TrayMenu.Add("Reload", (*) => Reload())
|
||||||
TrayMenu.Add()
|
TrayMenu.Add()
|
||||||
TrayMenu.Add("Exit", (*) => ExitApp())
|
TrayMenu.Add("Exit", (*) => ExitApp())
|
||||||
TrayMenu.Default := "Open"
|
TrayMenu.Default := "Suspend Hotkeys"
|
||||||
|
|
||||||
MenuHandler(ItemName, ItemPos, MyMenu) {
|
MenuHandler(ItemName, ItemPos, MyMenu) {
|
||||||
If (ItemName = "Exit")
|
If (ItemName = "Exit")
|
||||||
|
|||||||
Reference in New Issue
Block a user