Small cosmetic changes, also added some default keys to F7 hotkey, maybe should stop using F keys...

This commit is contained in:
PhatDave
2021-11-02 15:24:31 +01:00
parent 3cf2894854
commit d82d7cee48
2 changed files with 29 additions and 58 deletions

View File

@@ -5,8 +5,8 @@ SetWorkingDir %A_ScriptDir%
#SingleInstance force #SingleInstance force
#Persistent #Persistent
SetKeyDelay, -1 SetKeyDelay, 0
SetControlDelay, -1 SetControlDelay, 100
ih := InputHook("B") ih := InputHook("B")
ih.KeyOpt("{All}", "NV") ih.KeyOpt("{All}", "NV")
@@ -28,22 +28,6 @@ global paused := 0
SetTimer, ResetHook, -60000 SetTimer, ResetHook, -60000
whitelistKeys["q"] := 1
whitelistKeys["e"] := 1
whitelistKeys[1] := 1
whitelistKeys[2] := 1
whitelistKeys[3] := 1
whitelistKeys[4] := 1
whitelistKeys[5] := 1
whitelistKeys["LShift"] := 1
whitelistKeys["LControl"] := 1
whitelistKeys["g"] := 1
whitelistKeys["v"] := 1
whitelistKeys["r"] := 1
whitelistKeys["f"] := 1
whitelistKeys["c"] := 1
whitelistKeys["y"] := 1
OnKeyDown(InputHook, VK, SC) { OnKeyDown(InputHook, VK, SC) {
if (!paused) { if (!paused) {
key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC)) key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC))
@@ -86,15 +70,6 @@ OnKeyDown(InputHook, VK, SC) {
} }
} }
ShowTooltip(text) {
ToolTip, %text%
SetTimer, RemoveToolTip, -800
}
RemoveToolTip:
ToolTip
return
OnKeyUp(InputHook, VK, SC) { OnKeyUp(InputHook, VK, SC) {
if (!paused) { if (!paused) {
key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC)) key := GetKeyName(Format("vk{:x}sc{:x}", VK, SC))
@@ -106,6 +81,15 @@ OnKeyUp(InputHook, VK, SC) {
} }
} }
ShowTooltip(text) {
ToolTip, %text%
SetTimer, RemoveToolTip, -800
}
RemoveToolTip:
ToolTip
return
; Not really mine at all ; Not really mine at all
SortArray(Array, Order="A") { SortArray(Array, Order="A") {
;Order A: Ascending, D: Descending, R: Reverse ;Order A: Ascending, D: Descending, R: Reverse
@@ -352,6 +336,24 @@ F6::
TogglePause() TogglePause()
return return
F7::
whitelistKeys["q"] := 1
whitelistKeys["e"] := 1
whitelistKeys[1] := 1
whitelistKeys[2] := 1
whitelistKeys[3] := 1
whitelistKeys[4] := 1
whitelistKeys[5] := 1
whitelistKeys["LShift"] := 1
whitelistKeys["LControl"] := 1
whitelistKeys["g"] := 1
whitelistKeys["v"] := 1
whitelistKeys["r"] := 1
whitelistKeys["f"] := 1
whitelistKeys["c"] := 1
whitelistKeys["y"] := 1
return
ButtonSave: ButtonSave:
Gui, Submit Gui, Submit
WhitelistKeys(KeyLogUI) WhitelistKeys(KeyLogUI)

31
ssddddd
View File

@@ -1,31 +0,0 @@
diff --git a/Echo.ahk b/Echo.ahk
index fa4413e..d0a0292 100644
--- a/Echo.ahk
+++ b/Echo.ahk
@@ -24,6 +24,8 @@ enabledWindows.Push(Array())
global keyLog := Array()
global whitelistKeys := Array()

+SetTimer, ResetHook, -60000
+
; whitelistKeys["q"] := 1
; whitelistKeys["e"] := 1
; whitelistKeys[1] := 1
@@ -277,6 +279,17 @@ RemoveCurrentWindow() {
}
}

+ResetHook:
+ ih := InputHook("B")
+ ih.KeyOpt("{All}", "NV")
+ ih.OnKeyDown := Func("OnKeyDown")
+ ih.OnKeyUp := Func("OnKeyUp")
+ ih.Start()
+ ; Tooltip, WIN
+ SetTimer, ResetHook, -60000
+return
+
+
F5::
ih := InputHook("B")
ih.KeyOpt("{All}", "NV")