From 72e203e6946f2e1d11b4cfff20cccfb58aee1039 Mon Sep 17 00:00:00 2001 From: Tim Thompson Date: Sun, 14 Jul 2024 22:08:58 -0700 Subject: [PATCH] autohotkey scripts for connecting to miracast --- scripts/miracastconnect.ahk | 17 +++++++++++++++++ scripts/miracastdisconnect.ahk | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 scripts/miracastconnect.ahk create mode 100644 scripts/miracastdisconnect.ahk diff --git a/scripts/miracastconnect.ahk b/scripts/miracastconnect.ahk new file mode 100644 index 00000000..18bd58a0 --- /dev/null +++ b/scripts/miracastconnect.ahk @@ -0,0 +1,17 @@ +#Requires AutoHotkey v2.0 + +monitorCount := SysGet(80) + +MsgBox("Number of monitors: " monitorCount) + +if ( monitorCount < 2 ) { + + MsgBox("Trying to connect Miracast display") + Send '#k' + Sleep 1000 + Send "{Tab}" + Sleep 1000 + Send "{Enter}" + Sleep 1000 + Send "{Esc}" +} diff --git a/scripts/miracastdisconnect.ahk b/scripts/miracastdisconnect.ahk new file mode 100644 index 00000000..d7031f57 --- /dev/null +++ b/scripts/miracastdisconnect.ahk @@ -0,0 +1,15 @@ +#Requires AutoHotkey v2.0 + +MsgBox("Trying to disconnect Miracast display") + +Send '#k' +Sleep 1000 +Send "{Tab}" +Sleep 1000 +Send "{Tab}" +Sleep 1000 +Send "{Tab}" +Sleep 1000 +Send "{Enter}" +Sleep 1000 +Send "{Esc}"