Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python wrapper of minitouch #40

Open
williamfzc opened this issue Dec 23, 2018 · 2 comments
Open

Python wrapper of minitouch #40

williamfzc opened this issue Dec 23, 2018 · 2 comments

Comments

@williamfzc
Copy link

williamfzc commented Dec 23, 2018

Like this project. 👍

For easier usage, I wrote a python wrapper of it. pyminitouch

With this, user can easily call python API to use minitouch. Need not care about dependencies / devices / version.

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!

You can view github page for further usage.

@KavithaRamkrishnan
Copy link

how to use this in Minicap. Please help.

@williamfzc
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants