Coder Social home page Coder Social logo

linux-mice's Introduction

Catch events from multiple mice on Linux by Python

It might be useful for controlling something in Linux or hardware, connected to linux PC (e.g. Raspberry Pi), using internal mouse buttons, wheel and optical sensor. It will be still only one mouse cursor on the screen. To have multiple mouse cursors - try Multi-pointer X. It works both in GUI and in console-only modes. The program reads from files mouse* in the folder /dev/input.

This is an example, when up to four mice connected to Raspberry Pi Zero via USB HUB HAT and extra USB-hub. In this case connecting WiFi adapter to the USB HUB HAT hangs the system - it's recommened to connect it to extra USB-hub for stubility.

image

USB HUB HAT behaves more stable in this then case, than regular USB-hubs (tried cheap and more expencive ones, with external power). This USB HUB HAT actually can be connected to the RPi board with micro-USB to USB-A cable - no need to connect it to GPIO connector.

Run:

python3 multiple-mice.py

Because of large number of printed messages - the program consumes 100% of RPi Zero CPU. When print() is commented (not used) - 10-15% of CPU for moving 2 mice, up to 50% for moving 4 mice.

linux-mice's People

Contributors

satr avatar

Watchers

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