Coder Social home page Coder Social logo

sefsh / kodi-airmouse-0c45-2702 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hellogravity/air-mouse-xbmc-sender

1.0 3.0 0.0 179 KB

Reads button presses from a "2.4G Wireless Device" air mouse and sends them to Kodi through EventServer.

Python 100.00%

kodi-airmouse-0c45-2702's Introduction

Air Mouse for Kodi

I am using this cheap air mouse I got from DX:

sku_382619_2

"2.4GHz Motion Sensing Air Mouse + Remote Control - Black". Vendor ID: 0c45 Product ID: 2702

Anyone with this mouse and Kodi will agree that using it is very annoying, especially if you want to use it as a remote and disable the gyro mouse feature.

This is a script I wrote to fix the annoyances. It reads key presses from this air mouse, and sends them to Kodi through EventServer. It works on a Raspberry Pi with OSMC.

The script reads all the button presses, and sends them to Kodi on the same machine, and it does not care if the mouse is in 'mouse' mode, or in 'mouse disabled' mode.

It only respond to key presses, and ignores all mouse events, so that the device will only work as a remote and not as a mouse.

The script XBMCClient.py is taken from the Kodi repo: https://github.com/xbmc/xbmc/blob/master/tools/EventClients/lib/python/xbmcclient.py

The script reads the input from "/dev/input/" and searches the files that start with "usb-2.4G_2.4G_Wireless_Device-".

Since XBMC uses the EVIOCGRAB operation, it is impossible to read the files after XBMC has launched, so in order to fix that, the script is called from rc.local, and it also uses EVIOCGRAB, to prevent XBMC from accessing the device files.

If you want to use this (instructions are for OSMC on the Raspberry Pi):

  1. Take script.py and XBMCClient.py and put them in a directory (I used /home/osmc/kodi-airmouse-0c45-2702/)

  2. Have the script to run at boot: sudo nano /etc/rc.local

  3. On a line just above exit 0, enter python /home/osmc/kodi-airmouse-0c45-2702/script.py &

  4. chmod +x /home/osmc/kodi-airmouse-0c45-2702/script.py

  5. Put airmouse.xml in /home/osmc/.kodi/userdata/keymaps.

  6. Reboot

kodi-airmouse-0c45-2702's People

Contributors

hellogravity avatar sefsh avatar

Stargazers

 avatar

Watchers

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