Skip to content

Commit a6d0676

Browse files
author
Clive Galway
committed
Implement PauseHotkey / ResumeHotkey support for ITH
1 parent 58428e7 commit a6d0676

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## [Unreleased]
77
### Added
8+
Implemented PauseHotkey / ResumeHotkey for InterceptionTapHold
89
### Changed
910
### Deprecated
1011
### Removed

lib/InterceptionTapHold.ahk

+13-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,26 @@ class InterceptionKeyManager extends KeyManager {
2828
}
2929

3030
DeclareHotkeys(){
31+
this.SetState(1)
32+
}
33+
34+
SetState(state){
3135
if (this.manager.isMouse){
3236
if (!this.mouseButtonIds.HasKey(this.keyName)){
3337
MsgBox % "Unknown Mouse Button name " this.keyName
3438
ExitApp
3539
}
3640
keyName := this.mouseButtonIds[this.keyName]
37-
result := this.manager.AHI.SubscribeMouseButton(this.manager.id, keyName, this.block, this.KeyEvent.Bind(this))
41+
if (state)
42+
result := this.manager.AHI.SubscribeMouseButton(this.manager.id, keyName, this.block, this.KeyEvent.Bind(this))
43+
else
44+
result := this.manager.AHI.UnsubscribeMouseButton(this.manager.id, keyName)
45+
3846
} else {
39-
result := this.manager.AHI.SubscribeKey(this.manager.id, GetKeySC(this.keyName), this.block, this.KeyEvent.Bind(this))
47+
if (state)
48+
result := this.manager.AHI.SubscribeKey(this.manager.id, GetKeySC(this.keyName), this.block, this.KeyEvent.Bind(this))
49+
else
50+
result := this.manager.AHI.UnsubscribeKey(this.manager.id, GetKeySC(this.keyName))
4051
}
4152
}
4253
}

0 commit comments

Comments
 (0)