Can now be paused with F6
This commit is contained in:
96
Echo.ahk
96
Echo.ahk
@@ -24,6 +24,8 @@ enabledWindows.Push(Array())
|
|||||||
global keyLog := Array()
|
global keyLog := Array()
|
||||||
global whitelistKeys := Array()
|
global whitelistKeys := Array()
|
||||||
|
|
||||||
|
global paused := 0
|
||||||
|
|
||||||
SetTimer, ResetHook, -60000
|
SetTimer, ResetHook, -60000
|
||||||
|
|
||||||
whitelistKeys["q"] := 1
|
whitelistKeys["q"] := 1
|
||||||
@@ -32,6 +34,7 @@ whitelistKeys[1] := 1
|
|||||||
whitelistKeys[2] := 1
|
whitelistKeys[2] := 1
|
||||||
whitelistKeys[3] := 1
|
whitelistKeys[3] := 1
|
||||||
whitelistKeys[4] := 1
|
whitelistKeys[4] := 1
|
||||||
|
whitelistKeys[5] := 1
|
||||||
whitelistKeys["LShift"] := 1
|
whitelistKeys["LShift"] := 1
|
||||||
whitelistKeys["LControl"] := 1
|
whitelistKeys["LControl"] := 1
|
||||||
whitelistKeys["g"] := 1
|
whitelistKeys["g"] := 1
|
||||||
@@ -42,42 +45,44 @@ whitelistKeys["c"] := 1
|
|||||||
whitelistKeys["y"] := 1
|
whitelistKeys["y"] := 1
|
||||||
|
|
||||||
OnKeyDown(InputHook, VK, SC) {
|
OnKeyDown(InputHook, VK, SC) {
|
||||||
key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC))
|
if (!paused) {
|
||||||
if (addNext) {
|
key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC))
|
||||||
if (!whitelistKeys.HasKey(Key)) {
|
if (addNext) {
|
||||||
whitelistKeys[key] := 1
|
if (!whitelistKeys.HasKey(Key)) {
|
||||||
sstring := "Added "
|
whitelistKeys[key] := 1
|
||||||
sstring .= key
|
sstring := "Added "
|
||||||
ShowTooltip(sstring)
|
sstring .= key
|
||||||
addNext := 0
|
ShowTooltip(sstring)
|
||||||
} else {
|
addNext := 0
|
||||||
sstring := "Key already exists"
|
} else {
|
||||||
ShowTooltip(sstring)
|
sstring := "Key already exists"
|
||||||
addNext := 0
|
ShowTooltip(sstring)
|
||||||
|
addNext := 0
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return
|
if (removeNext) {
|
||||||
}
|
if (whitelistKeys.HasKey(Key)) {
|
||||||
if (removeNext) {
|
whitelistKeys.Remove(key)
|
||||||
if (whitelistKeys.HasKey(Key)) {
|
sstring := "Removed "
|
||||||
whitelistKeys.Remove(key)
|
sstring .= key
|
||||||
sstring := "Removed "
|
ShowTooltip(sstring)
|
||||||
sstring .= key
|
removeNext := 0
|
||||||
ShowTooltip(sstring)
|
} else {
|
||||||
removeNext := 0
|
sstring := "Key not found"
|
||||||
} else {
|
ShowTooltip(sstring)
|
||||||
sstring := "Key not found"
|
removeNext := 0
|
||||||
ShowTooltip(sstring)
|
}
|
||||||
removeNext := 0
|
return
|
||||||
}
|
}
|
||||||
return
|
if (whitelistKeys.HasKey(key)) {
|
||||||
}
|
for k, v in enabledWindows[1] {
|
||||||
if (whitelistKeys.HasKey(key)) {
|
ControlSend,, {%key% down}, ahk_pid %v%
|
||||||
for k, v in enabledWindows[1] {
|
}
|
||||||
ControlSend,, {%key% down}, ahk_pid %v%
|
}
|
||||||
|
if (!keyLog.HasKey(key)) {
|
||||||
|
keyLog[key] := SC,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!keyLog.HasKey(key)) {
|
|
||||||
keyLog[key] := SC,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,10 +96,12 @@ RemoveToolTip:
|
|||||||
return
|
return
|
||||||
|
|
||||||
OnKeyUp(InputHook, VK, SC) {
|
OnKeyUp(InputHook, VK, SC) {
|
||||||
key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC))
|
if (!paused) {
|
||||||
if (whitelistKeys.HasKey(key)) {
|
key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC))
|
||||||
for k, v in enabledWindows[1] {
|
if (whitelistKeys.HasKey(key)) {
|
||||||
ControlSend,, {%key% up}, ahk_pid %v%
|
for k, v in enabledWindows[1] {
|
||||||
|
ControlSend,, {%key% up}, ahk_pid %v%
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,6 +299,17 @@ ResetHook:
|
|||||||
SetTimer, ResetHook, -30000
|
SetTimer, ResetHook, -30000
|
||||||
return
|
return
|
||||||
|
|
||||||
|
TogglePause() {
|
||||||
|
if (paused) {
|
||||||
|
ShowTooltip("Unpaused")
|
||||||
|
paused := 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ShowTooltip("Paused")
|
||||||
|
paused := 1
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
F5::
|
F5::
|
||||||
ih.Stop()
|
ih.Stop()
|
||||||
@@ -330,6 +348,10 @@ F4::
|
|||||||
WhitelistButtonUI()
|
WhitelistButtonUI()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
F6::
|
||||||
|
TogglePause()
|
||||||
|
return
|
||||||
|
|
||||||
ButtonSave:
|
ButtonSave:
|
||||||
Gui, Submit
|
Gui, Submit
|
||||||
WhitelistKeys(KeyLogUI)
|
WhitelistKeys(KeyLogUI)
|
||||||
|
Reference in New Issue
Block a user