diff --git a/README-zh.md b/README-zh.md index 39ec4e2..d58af32 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,4 +1,4 @@ -# Scrcpy-mask +# Scrcpy Mask 为了实现电脑控制安卓设备,本人使用 Tarui + Vue 3 + Rust 开发了一款跨平台桌面客户端。该客户端能够提供可视化的鼠标和键盘按键映射配置。通过按键映射实现了实现类似安卓模拟器的多点触控操作,具有毫秒级响应速度。该工具可广泛用于电脑控制安卓设备玩手游等等,提供流畅的触控体验。 @@ -31,6 +31,7 @@ ## 视频演示 +- [DNF 手游触屏操作反人类?但又不能在模拟器上玩 DNF 手游?不好意思,Scrcpy Mask “模拟器”的机制遥遥领先](https://www.bilibili.com/video/BV17U411Z7cN/?share_source=copy_web&vd_source=36923115230d8a46ae8b587fc5348e6e) - [如何用电脑玩 FPS 手游?这样的“安卓模拟器”,也不是不可以-哔哩哔哩](https://www.bilibili.com/video/BV1EU411Z7TC/?share_source=copy_web&vd_source=36923115230d8a46ae8b587fc5348e6e) - [M 系列 Mac 电脑玩王者,暃排位实录,使用 Android Stuido 模拟器和开源 Scrcpy Mask 按键映射工具-哔哩哔哩](https://b23.tv/q6iDW1w) - [自制跨平台开源项目 Scrcpy Mask ,像模拟器一样用键鼠控制任意安卓设备!以 M 系列芯片 MacBook 打王者为例-哔哩哔哩](https://b23.tv/gqmriXr) @@ -64,9 +65,9 @@ 1. 从 [releases](https://github.com/AkiChase/scrcpy-mask/releases) 中安装适合你系统平台的软件包 2. 确认你的安卓设备类型 1. 对于手机或平板电脑等物理设备 - 1. 你需要自己解决投屏的问题。推荐使用设备品牌的官方投屏方式,这样一般延迟最小。 + 1. 你需要自己解决投屏的问题。推荐使用设备品牌的官方投屏方式,这样一般延迟最小。自 `v0.5.0` 版本起,可以配合[ScreenStream](https://github.com/dkrivoruchko/ScreenStream)在同一局域网下投屏。 2. 通过 USB 或无线方式在设备上启用 ADB 调试,然后将其连接到电脑。 - 2. 对于模拟器,不仅不需要投屏,而且模拟器通常默认启用 ADB 有线调试。所以几乎不用操作就能获得最好的体验。 + 2. 对于模拟器,不仅不需要投屏,而且模拟器通常默认已经启用了 ADB 有线调试。所以几乎不用操作就能获得最好的体验。 3. 启动软件并导航到设备页面。 1. 在可用的设备中查找你的设备(如果未找到,请自行搜索如何为安装设备启用 ADB 调试)。 2. 右击设备并选择“控制此设备”。 diff --git a/README.md b/README.md index 6bd5181..e77ee68 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Scrcpy-mask +# Scrcpy Mask [中文介绍](./README-zh.md) @@ -33,6 +33,7 @@ Furthermore, to better support interaction between Scrcpy Mask and Android devic ## Demonstration video +- [DNF 手游触屏操作反人类?但又不能在模拟器上玩 DNF 手游?不好意思,Scrcpy Mask “模拟器”的机制遥遥领先](https://www.bilibili.com/video/BV17U411Z7cN/?share_source=copy_web&vd_source=36923115230d8a46ae8b587fc5348e6e) - [如何用电脑玩 FPS 手游?这样的“安卓模拟器”,也不是不可以-哔哩哔哩](https://www.bilibili.com/video/BV1EU411Z7TC/?share_source=copy_web&vd_source=36923115230d8a46ae8b587fc5348e6e) - [M 系列 Mac 电脑玩王者,暃排位实录,使用 Android Stuido 模拟器和开源 Scrcpy Mask 按键映射工具-哔哩哔哩](https://b23.tv/q6iDW1w) - [自制跨平台开源项目 Scrcpy Mask ,像模拟器一样用键鼠控制任意安卓设备!以 M 系列芯片 MacBook 打王者为例-哔哩哔哩](https://b23.tv/gqmriXr) @@ -66,7 +67,7 @@ Furthermore, to better support interaction between Scrcpy Mask and Android devic 1. Install software suitable for your system platform from [releases](https://github.com/AkiChase/scrcpy-mask/releases) 2. Identify your Android device type 1. For physical devices like phones or tablets - 1. You need to solve the problem of screen casting on your own. Recommend using the official screen mirror method of your device brand to achieve the minimum delay + 1. You need to solve the problem of screen casting on your own. Recommend using the official screen mirror method of your device brand to achieve the minimum delay. Since `v0.5.0` version, it can be used with [ScreenStream](https://github.com/dkrivoruchko/ScreenStream) to cast screen under the same LAN. 2. Enable ADB debugging on your device via USB or wirelessly, then connect it to your computer. 2. For emulator, you don't need screen mirror, and emulator generally default to enabling ADB wired debugging. So this is the best way for game, I think. 3. Launch the software and navigate to the Device page. diff --git a/src/components/Device.vue b/src/components/Device.vue index a134d32..bcdcd01 100644 --- a/src/components/Device.vue +++ b/src/components/Device.vue @@ -60,6 +60,8 @@ let deviceWaitForMetadataTask: ((deviceName: string) => void) | null = null; let deviceWaitForScreenSizeTask: ((w: number, h: number) => void) | null = null; let unlisten: UnlistenFn | undefined; +let lastClipboard = ""; + onMounted(async () => { unlisten = await listen("device-reply", (event) => { try { @@ -69,10 +71,19 @@ onMounted(async () => { deviceWaitForMetadataTask?.(payload.deviceName); break; case "ClipboardChanged": - console.log("ClipboardChanged", payload.clipboard); + if (payload.clipboard === lastClipboard) break; + lastClipboard = payload.clipboard; + navigator.clipboard + .writeText(payload.clipboard) + .then(() => { + message.info(t("pages.Device.clipboard.deviceSync.success")); + }) + .catch((e) => { + console.error(e); + message.error(t("pages.Device.clipboard.deviceSync.failed")); + }); break; case "ClipboardSetAck": - console.log("ClipboardSetAck", payload.sequence); break; case "DeviceRotation": if (deviceWaitForScreenSizeTask) { @@ -222,7 +233,7 @@ function onMenuClickoutside() { async function deviceControl() { let curClientInfo = await getCurClientInfo(); if (curClientInfo) { - message.warning(t("pages.Device.alreadyControled")); + message.error(t("pages.Device.alreadyControled")); store.controledDevice = { scid: curClientInfo.scid, deviceName: curClientInfo.device_name, @@ -236,12 +247,6 @@ async function deviceControl() { port.value = 27183; } - if (store.controledDevice) { - message.error(t("pages.Device.deviceControl.closeCurDevice")); - store.hideLoading(); - return; - } - message.info(t("pages.Device.deviceControl.controlInfo")); const device = devices.value[rowIndex]; diff --git a/src/components/setting/Mask.vue b/src/components/setting/Mask.vue index 0653b6f..a25c38f 100644 --- a/src/components/setting/Mask.vue +++ b/src/components/setting/Mask.vue @@ -178,7 +178,7 @@ onUnmounted(() => {