npm

Need private packages and team management tools?Check out npm Orgs. »

libpointing

1.0.6 • Public • Published

libpointing

Libpointing Node.js bindings

Description

Libpointing is an open-source cross-platform library that provides direct access to HID pointing devices and supports the design of pointing transfer functions.

Installation

Note that, libpointing with npm can be installed only on Mac OS and Linux.

Example

var pointing = require('libpointing');
 
if (process.argv.length < 5)
    console.log("Usage: node", process.argv[1], "[inputdeviceURI [outputdeviceURI [transferfunctionURI]]]")
 
var input = new pointing.PointingDevice((process.argv[2]) ? process.argv[2] : "any:")
var output = new pointing.DisplayDevice((process.argv[3]) ? process.argv[3] : "any:");
var tFunc = new pointing.TransferFunction((process.argv[4]) ? process.argv[4] : "system:", input, output);
 
input.setPointingCallback(function(timestamp, dx, dy, buttons) {
    var pixels = tFunc.applyi(dx, dy, timestamp);
    console.log(timestamp, dx, dy, buttons, " -> ", pixels.dx, pixels.dy);
});
 
var manager = new pointing.PointingDeviceManager().addDeviceUpdateCallback(
    function(deviceDescriptor, wasAdded) {
        console.log(deviceDescriptor, wasAdded);
    }
);

License

This software may be used and distributed according to the terms of the GNU General Public License version 2 or any later version.

Keywords

none

install

npm i libpointing

Downloadsweekly downloads

56

version

1.0.6

license

GPL-2.0-or-later

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability