Skip to content

Commit

Permalink
auto reload when an active window is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuheiKubota committed Mar 18, 2023
1 parent 63f3fc3 commit 796b001
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions k7jis.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ A_TrayMenu.Add "&Toggle", MenuToggleFMode
A_TrayMenu.Default := "&Toggle"
A_TrayMenu.ClickCount := 1

SetTimer onTimer, 10*1000

; missing keys
; alt+^ -> \|
!^::\
Expand Down Expand Up @@ -96,3 +98,15 @@ ToggleFMode()
TrayTip msg, appName, 4+16+32
SetTimer () => TrayTip(), -3000
}

lastWindow := EnvGet("K7JIS_LASTWINDOW")
onTimer()
{
win := String(WinActive("A"))
global lastWindow

if win != lastWindow {
EnvSet("K7JIS_LASTWINDOW", win)
Reload
}
}

0 comments on commit 796b001

Please sign in to comment.