nodeevdev
Basic libevdev binding for node.js
Example
#!/usr/bin/env node var Evdev = ; var dev = Evdev;dev; // Hack to prevent Node.js from exiting, sorry.var http = ;var httpServer = http;httpServer;console;
Methods
Factory
evdev::create()
Returns an initialised evdev object.
- Returns: An initialised evdev object.
evdev object
evdevObject::open( path, callback( evdevObject, error ) )
Open an evdev device, associate it to this object, and fire the provided callback upon completion.
The parameters passed to the provided callback function are evdevObject which is a reference to the evdev object, and error which will be an error string in the case of an error, or undefined on success.
- Returns: A reference to itself.
evdevObject::data( evdevEvent )
A virtual method of the evdevObject. Reimplement it to handle evdevEvents. It can be ignored, but if you ignore it, you might as well not use this module at all.
evdevObject::closed( evdevObject )
A virtual method of the evdevObject. Reimplement it to react to the device being closed. Otherwise it can be ignored.