Skip to content

Commit

Permalink
Make instance 'NoHotkeys' more useful
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejGolian committed Aug 14, 2024
1 parent 785de35 commit 2bdd5a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
17 changes: 9 additions & 8 deletions Includes/Overlays/Kontakt.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Class Kontakt {

Class CloseMenu {
Static Call(Type, ThisHotkey) {
Thread "NoTimers"
SendCommand := ""
If ThisHotkey = "Escape"
SendCommand := "{Escape}"
Expand All @@ -252,26 +253,26 @@ Class Kontakt {
HotIfWinActive(ReaHotkey.PluginWinCriteria)
If Type = "Standalone"
HotIf
If Type = "Plugin" And WinActive(ReaHotkey.PluginWinCriteria) And ReaHotkey.FoundPlugin Is Plugin And ReaHotkey.FoundPlugin.Name = "Kontakt" {
%Type%.SetNoHotkeys("Kontakt", False)
If Type = "Plugin" And ReaHotkey.FoundPlugin Is Plugin And ReaHotkey.FoundPlugin.Name = "Kontakt" And ReaHotkey.FoundPlugin.NoHotkeys = True {
ReaHotkey.FoundPlugin.SetNoHotkeys(False)
TurnHotkeysOff()
If SendCommand != ""
Send SendCommand
}
Else If Type = "Plugin" And WinActive(ReaHotkey.PluginWinCriteria) And ReaHotkey.FoundPlugin Is Plugin And ReaHotkey.FoundPlugin.Name = "Kontakt Content Missing Dialog" {
%Type%.SetNoHotkeys("Kontakt", False)
Else If Type = "Plugin" And ReaHotkey.FoundPlugin Is Plugin And ReaHotkey.FoundPlugin.Name = "Kontakt Content Missing Dialog" {
Plugin.SetNoHotkeys("Kontakt", False)
TurnHotkeysOff()
If SendCommand != ""
Send SendCommand
}
Else If Type = "Standalone" And WinActive("Kontakt ahk_class NINormalWindow* ahk_exe Kontakt 7.exe") {
%Type%.SetNoHotkeys("Kontakt", False)
Else If Type = "Standalone" And ReaHotkey.foundStandalone Is Standalone And ReaHotkey.foundStandalone.Name = "Kontakt" And ReaHotkey.FoundStandalone.NoHotkeys = True {
ReaHotkey.foundStandalone.SetNoHotkeys(False)
TurnHotkeysOff()
If SendCommand != ""
Send SendCommand
}
Else If Type = "Standalone" And WinExist("Content Missing ahk_class #32770 ahk_exe Kontakt 7.exe") And WinActive("Content Missing ahk_class #32770 ahk_exe Kontakt 7.exe") {
%Type%.SetNoHotkeys("Kontakt", False)
Else If Type = "Standalone" And ReaHotkey.foundStandalone Is Standalone And ReaHotkey.foundStandalone.Name = "Kontakt Content Missing Dialog" {
Standalone.SetNoHotkeys("Kontakt", False)
TurnHotkeysOff()
If SendCommand != ""
Send SendCommand
Expand Down
6 changes: 5 additions & 1 deletion Lib/Program.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ Class Program {
}

SetNoHotkeys(Value) {
%This.__Class%.SetNoHotkeys(This.Name, Value)
This.NoHotkeys := Value
If Value = False
ReaHotkey.Turn%This.__Class%HotkeysOn(This.Name)
If Value = True
ReaHotkey.Turn%This.__Class%HotkeysOff(This.Name)
}

SetTimer(Function, Period := "", Priority := "") {
Expand Down

0 comments on commit 2bdd5a1

Please sign in to comment.