GithubHelp home page GithubHelp logo

evdev's Introduction

evdev

Travis Crates.io

Documentation

Nice(r) access to evdev devices.

What is evdev?

evdev is the Linux kernel's generic input interface, also implemented by other kernels such as FreeBSD.

This crate exposes access to these sorts of input devices. There is some trickery involved, so please read the crate documentation.

What does this library support?

This library exposes raw evdev events, but uses the Rust Iterator trait to do so. When processing events via fetch_events, the library will handle SYN_DROPPED events by injecting fake state updates in an attempt to ensure callers see state transition messages consistent with actual device state. When processing via *_no_sync this correction is not done, and SYN_DROPPED messages will appear if the kernel ring buffer is overrun before messages are read. I try to match libevdev closely, where possible.

Writing to devices is not yet supported (eg, turning LEDs on).

There is no abstraction for gamepad-like devices that allows mapping button numbers to logical buttons, nor is one planned. Such a thing should take place in a higher-level crate, likely supporting multiple platforms.

Example

See <examples/evtest.rs> for an example of using this library (which roughly corresponds to the userspace evtest tool.

evdev's People

Contributors

anytimetraveler avatar coolreader18 avatar emberian avatar jeff-hiner avatar linuscde avatar nowakf avatar ralith avatar valpackett 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.