Compare commits
5 Commits
d82d7cee48
...
HWNDRework
| Author | SHA1 | Date | |
|---|---|---|---|
| 715ddfa24d | |||
|
|
999531d2ab | ||
|
|
e028a339a2 | ||
|
|
ed246a7b02 | ||
|
|
f7bd71453c |
92
Echo.ahk
92
Echo.ahk
@@ -1,12 +1,12 @@
|
|||||||
#NoEnv
|
#NoEnv
|
||||||
#Warn
|
|
||||||
SendMode Input
|
SendMode Input
|
||||||
SetWorkingDir %A_ScriptDir%
|
SetWorkingDir %A_ScriptDir%
|
||||||
#SingleInstance force
|
#SingleInstance force
|
||||||
#Persistent
|
#Persistent
|
||||||
|
|
||||||
SetKeyDelay, 0
|
SetBatchLines, -1
|
||||||
SetControlDelay, 100
|
SetKeyDelay, -1, 100
|
||||||
|
SetControlDelay, 500
|
||||||
|
|
||||||
ih := InputHook("B")
|
ih := InputHook("B")
|
||||||
ih.KeyOpt("{All}", "NV")
|
ih.KeyOpt("{All}", "NV")
|
||||||
@@ -61,7 +61,10 @@ OnKeyDown(InputHook, VK, SC) {
|
|||||||
}
|
}
|
||||||
if (whitelistKeys.HasKey(key)) {
|
if (whitelistKeys.HasKey(key)) {
|
||||||
for k, v in enabledWindows[1] {
|
for k, v in enabledWindows[1] {
|
||||||
ControlSend,, {%key% down}, ahk_pid %v%
|
; ControlSend,, {%key% down}, ahk_pid %v%
|
||||||
|
; Random, rand, 50, 2000
|
||||||
|
; Sleep %rand%
|
||||||
|
ControlSend,, {%key% down}, ahk_id %v%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!keyLog.HasKey(key)) {
|
if (!keyLog.HasKey(key)) {
|
||||||
@@ -70,12 +73,21 @@ OnKeyDown(InputHook, VK, SC) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; ~LButton::
|
||||||
|
; MouseGetPos, xpos, ypos
|
||||||
|
; for k, v in enabledWindows[1] {
|
||||||
|
; ControlClick, xpos ypos, ahk_id %v%
|
||||||
|
; ControlClick,, {%key% down}, ahk_id %v%
|
||||||
|
; }
|
||||||
|
; 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))
|
||||||
if (whitelistKeys.HasKey(key)) {
|
if (whitelistKeys.HasKey(key)) {
|
||||||
for k, v in enabledWindows[1] {
|
for k, v in enabledWindows[1] {
|
||||||
ControlSend,, {%key% up}, ahk_pid %v%
|
; ControlSend,, {%key% up}, ahk_pid %v%
|
||||||
|
ControlSend,, {%key% up}, ahk_id %v%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,13 +255,14 @@ WhitelistKeys(string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddCurrentWindow() {
|
AddCurrentWindow() {
|
||||||
WinGet, activePID, PID, A
|
; WinGet, activePID, PID, A
|
||||||
if (!Find(enabledWindows[1], activePID)) {
|
WinGet, activeID, ID, A
|
||||||
|
if (!Find(enabledWindows[1], activeID)) {
|
||||||
WinGet, activeName, ProcessName, A
|
WinGet, activeName, ProcessName, A
|
||||||
enabledWindows[1].Insert(activePID)
|
enabledWindows[1].Insert(activeID)
|
||||||
enabledWindows[2].Insert(activeName)
|
enabledWindows[2].Insert(activeName)
|
||||||
sstring := "Added "
|
sstring := "Added "
|
||||||
sstring .= activePID
|
sstring .= activeID
|
||||||
sstring .= " ("
|
sstring .= " ("
|
||||||
sstring .= activeName
|
sstring .= activeName
|
||||||
sstring .= ") to echo list"
|
sstring .= ") to echo list"
|
||||||
@@ -258,13 +271,14 @@ AddCurrentWindow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RemoveCurrentWindow() {
|
RemoveCurrentWindow() {
|
||||||
WinGet, activePID, PID, A
|
; WinGet, activePID, PID, A
|
||||||
if (Find(enabledWindows[1], activePID)) {
|
WinGet, activeID, ID, A
|
||||||
|
if (Find(enabledWindows[1], activeID)) {
|
||||||
WinGet, activeName, ProcessName, A
|
WinGet, activeName, ProcessName, A
|
||||||
enabledWindows[1].RemoveAt(Find(enabledWindows[1], activePID))
|
enabledWindows[1].RemoveAt(Find(enabledWindows[1], activeID))
|
||||||
enabledWindows[2].RemoveAt(Find(enabledWindows[2], activeName))
|
enabledWindows[2].RemoveAt(Find(enabledWindows[2], activeName))
|
||||||
sstring := "Removed "
|
sstring := "Removed "
|
||||||
sstring .= activePID
|
sstring .= activeID
|
||||||
sstring .= " ("
|
sstring .= " ("
|
||||||
sstring .= activeName
|
sstring .= activeName
|
||||||
sstring .= ") from echo list"
|
sstring .= ") from echo list"
|
||||||
@@ -304,56 +318,38 @@ F5::
|
|||||||
ih.Start()
|
ih.Start()
|
||||||
return
|
return
|
||||||
|
|
||||||
F3::
|
; F3::
|
||||||
MakeUI()
|
; MakeUI()
|
||||||
return
|
; return
|
||||||
|
|
||||||
^!A::
|
; F4::
|
||||||
|
; WhitelistButtonUI()
|
||||||
|
; return
|
||||||
|
|
||||||
|
F3::
|
||||||
ShowTooltip("Adding key")
|
ShowTooltip("Adding key")
|
||||||
addNext := 1
|
addNext := 1
|
||||||
return
|
return
|
||||||
|
|
||||||
^!S::
|
F4::
|
||||||
ShowTooltip("Adding window")
|
|
||||||
AddCurrentWindow()
|
|
||||||
return
|
|
||||||
|
|
||||||
^!D::
|
|
||||||
ShowTooltip("Removing window")
|
|
||||||
RemoveCurrentWindow()
|
|
||||||
return
|
|
||||||
|
|
||||||
^!R::
|
|
||||||
ShowTooltip("Removing key")
|
ShowTooltip("Removing key")
|
||||||
removeNext := 1
|
removeNext := 1
|
||||||
return
|
return
|
||||||
|
|
||||||
F4::
|
^!X::
|
||||||
WhitelistButtonUI()
|
ShowTooltip("Adding window")
|
||||||
|
AddCurrentWindow()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
^!C::
|
||||||
|
ShowTooltip("Removing window")
|
||||||
|
RemoveCurrentWindow()
|
||||||
|
Return
|
||||||
|
|
||||||
F6::
|
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)
|
||||||
|
|||||||
9
MouseTest.ahk
Normal file
9
MouseTest.ahk
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#NoEnv
|
||||||
|
SetBatchLines, -1
|
||||||
|
#InstallMouseHook
|
||||||
|
|
||||||
|
; Mouse button event handlers
|
||||||
|
~LButton::
|
||||||
|
MouseGetPos, xpos, ypos
|
||||||
|
ToolTip, %xpos% %ypos%
|
||||||
|
return
|
||||||
Reference in New Issue
Block a user