Coder Social home page Coder Social logo

narendersaini32 / scrcpy-mask Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akichase/scrcpy-mask

0.0 0.0 0.0 15.44 MB

A Scrcpy client in Rust & Tarui aimed at providing mouse and key mapping to control Android device, similar to a game emulator

License: Apache License 2.0

JavaScript 0.54% Rust 15.82% TypeScript 41.97% CSS 0.17% HTML 0.10% Vue 41.41%

scrcpy-mask's Introduction

Scrcpy-mask

中文介绍

To achieve computer control of Android devices, I developed a cross-platform desktop client using Tarui + Vue 3 + Rust. This client provides visual mouse and keyboard mapping configuration, enabling multi-touch operations similar to Android emulators through key mapping, with millisecond-level response time. This tool can be widely used for controlling Android devices from computers to play mobile games, providing a smooth touch experience.

I express my deep respect and gratitude to the developers of the Scrcpy project. Scrcpy is a powerful and efficient open-source tool that greatly facilitates control over Android devices. This project is built upon the excellent architecture of Scrcpy, with optimizations and adjustments for mouse and keyboard control.

This project does not provide screen mirroring functionality—let me emphasize, it does not provide screen mirroring functionality! It only implements the Scrcpy control protocol.

Because screen mirroring may involve latency and blurriness issues, this project takes a different approach by directly abandoning screen mirroring and instead using a transparent mask to display the content behind the window (which can be AVD, low-latency screen mirroring provided by your phone manufacturers, etc.), Completely eliminates the problem of poor screen casting experience inherent in Scrcpy.

Furthermore, to better support interaction between Scrcpy Mask and Android devices, I have made some modifications to the scrcpy-server, leading to the creation of a separate branch project called scrcpy-mask-server.

Features

  • Wired and wireless connections to Android devices
  • Start scrcpy-server and connect to it
  • Implement scrcpy client control protocol
  • Mouse and keyboard key mapping
  • Visually setting the mapping
  • Key mapping config import and export
  • Update check
  • Toggle between key mapping and key input
  • Internationalization (i18n)
  • Gamepad key mapping
  • Better macro support
  • Provide external control through websocket, see external control
  • Help document

Demonstration video

Implementation principle

Screenshot

  • Device control

  • Key mapping setting

  • Mask above game

Basic using

  1. Install software suitable for your system platform from 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
      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.
    1. Find your device among the available devices (if not found, please search for how to enable ADB debugging for your device).
    2. Right-click on your device again and choose "Control this device".
  4. Navigate to the Settings page -> Mask Settings, set the width and height of the mask to the same ratio of the device screen size and ensure that the mask size is appropriate.
  5. Navigate to the Mask page where you can see a transparent mask. Next, adjust and move your emulator window or screen mirroring window to align the displayed content area with the transparent mask area.
  6. Navigate to the Key mapping page and switch or edit the key mapping configs.
  7. Return to the Mask page and start enjoying.

About Macros

Currently, the structure of macros is simply a JSON object with limited functionality, serving as a transitional solution. Please refrain from investing too much time in writing macros, as the specifications for macro creation may change with version updates.

An example of macros can be found in the async function execMacro function in hotkey.ts file.

For instance, the key-input-mode macro can switch from key mapping mode to key input mode, commonly used for text input. An example is as follows:

[{ "args": [], "type": "key-input-mode" }]

Error Report

When asking a question, please provide as much detailed information as possible regarding the issue, including the operating system and software version. Specifically, if there is an error output, please be sure to include the relevant logs.

There are two sources of logs that might help in identifying and solving the error. Generally, the error output can be found in the Web logs.

  1. Web Logs: Open Developer Tools by pressing Ctrl+Shift+I or Cmd+Opt+I, click on the console tab, and check the information output in the console.
  2. Rust Logs:
    1. On macOS or Linux, navigate to the installation directory, use the terminal to run scrcpy-mask, and you can see the program's output in real-time in the terminal.
    2. On Windows, you need to clone the project and run it yourself to view the Rust output.

Contribution.

If you are interested in this project, you are welcome to submit pull request or issue. But my time and energy is limited, so I may not be able to deal with it all.

Star History Chart

scrcpy-mask's People

Contributors

akichase avatar narendersaini32 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.