Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Persistent
- CoordMode "Mouse"
- ProcessSetPriority "B"
- scrcpy := "ahk_exe scrcpy.exe"
- ^!p:: ; Ctrl+Alt+P
- {
- TriggerScrcpy(false)
- }
- ^!o:: ; Ctrl+Alt+O
- {
- TriggerScrcpy(true)
- }
- TriggerScrcpy(otgMode)
- {
- if WinExist(scrcpy) {
- WinActivate
- Send "{Alt}"
- } else {
- SetWorkingDir "C:\Util\scrcpy"
- if (otgMode) {
- Run "scrcpy-noconsole.vbs --otg -s 12345678901234" ; replace with your USB Device ID
- WinWait(scrcpy)
- WinGetPos , , &w, &h
- WinMove -5, A_ScreenHeight - h - 35
- SetTimer CheckMousePos, 250
- } else {
- Run "scrcpy-noconsole.vbs"
- }
- }
- ;WinMoveBottom
- }
- CheckMousePos()
- {
- if not WinExist(scrcpy)
- return
- MouseGetPos &xpos, &ypos
- zone := xpos > 1 ? 0 : Max(Ceil(3 * ypos / A_ScreenHeight), 1)
- Switch zone {
- Case 1: ;top
- Case 2: ;middle
- {
- if GetKeyState("LAlt")
- TriggerScrcpy(true)
- }
- Case 3: ;bottom
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment