Genymobile/scrcpy: Display and control your Android device (github.com)是一款开源的安卓投屏软件,可以操控、共享剪切板、传文件等,局域网延迟也很低,除了启动没有商业软件那么方便外(当然也可以用自己服务器那就和商业软件一样了
此脚本只需点击按钮就能一键启动 scrcpy 的有线或无线连接,AHK也可以很方便编写快捷键
原文techotaku39/ConvenientScrcpy: Scripts of booting scrcpy and hotkey (github.com)发布在Github上所以用的英文注释,代码也比较少就懒得改了(逃
ConvenientScrcpy.ahk
SendMode Input
#IfWinActive ahk_class SDL_app ;Enable hotkeys when active scrcpy
Path:="C:\Program Files (x86)\scrcpy-win64-v1.17" ;Edit your scrcpy path
Gui Font,s12,Microsoft YaHei UI
Gui Add,Button,,USB
Gui Add,Button,,TCP
Gui Show
return
ButtonUSB:
Gui Destroy
Run %Path%\scrcpy.exe,%Path%
WinWaitActive ahk_class SDL_app
Send !o ;Turn device screen off after boot
WinHide %Path%\scrcpy.exe ;Hide the CMD after boot
return
ButtonTCP:
Gui Destroy
RunWait %A_ScriptDir%\sTCP.bat,%Path%,Hide
MsgBox 0x21,Success,Unplug to continue
IfMsgBox Cancel
ExitApp
Run %Path%\scrcpy.exe,%Path%
WinWaitActive ahk_class SDL_app
Send !o
WinHide %Path%\scrcpy.exe
return
;Hotkey:Send button
CapsLock & 1::
WinGetPos,,,w,h,ahk_class SDL_app
x:=632/1080*w ;x of send button / Screen width
y:=787/2400*h ;y of send button / Screen height
Click %x%,%y%
return
;Hotkey:Select words
CapsLock & 2::
Loop 1
Send {Right}
Send {Space}
return
CapsLock & 3::
Loop 2
Send {Right}
Send {Space}
return
CapsLock & 4::
Loop 3
Send {Right}
Send {Space}
return
CapsLock & 5::
Loop 4
Send {Right}
Send {Space}
return
CapsLock & 6::
Loop 5
Send {Right}
Send {Space}
return
#NoEnv
#SingleInstance Force
GuiClose:
ExitApp
sTCP.bat
@echo off
for /f "tokens=9" %%i in ('adb shell ip route') do set ip=%%i
adb tcpip 5555
adb connect %ip%:5555
Github上这个有一个给它配套的Gui
好家伙我之前以为这是第三方做的GUI?
?好像是第三方的吧,全英文看不懂。。。
不过简单投屏配置简单多了
这个投屏控制,我曾经用过,很不错,建议搞一些例子上来