Coder Social home page Coder Social logo

christmasboy / pyminitouch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from williamfzc/pyminitouch

0.0 0.0 0.0 63 KB

python wrapper of minitouch, for better experience

Home Page: https://pyminitouch.readthedocs.io

License: MIT License

Python 100.00%

pyminitouch's Introduction

pyminitouch

PyPI version

python wrapper of minitouch, for better experience.

中文文档

TL;DR

An easy way to use minitouch with python.

Before

  • Check device abi
  • Download a specified version minitouch
  • Install and run it
  • Build a socket
  • Send message with socket, and your message seems like:
    • d 0 150 150 50\nc\nu 0\nc\n
    • hard to read

An unfriendly process.

After

from pyminitouch import MNTDevice


_DEVICE_ID = '123456F'
device = MNTDevice(_DEVICE_ID)

# single-tap
device.tap([(400, 600)])
# multi-tap
device.tap([(400, 400), (600, 600)])
# set the pressure, default == 100
device.tap([(400, 600)], pressure=50)

# ... and something else you want, just like minitouch itself!

# and, after usage, you MUST call function `stop` to stop service
device.stop()

You don't need to care about installation/device version/dependencies anymore. All you need is running the script.

Read demo.py for detail.

Installation

Please use python3.

pip install pyminitouch

How it work?

  • Do the same things as Before in TLDR
  • Wrap it and offer pythonic API for users

Bug & Suggestion

Please let me know via issue :)

License

MIT

pyminitouch's People

Contributors

williamfzc avatar f6 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.