Skip to content

Commit

Permalink
made comments revision
Browse files Browse the repository at this point in the history
  • Loading branch information
mixal_bl4 committed Apr 4, 2017
1 parent deca737 commit 5ab433e
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 94 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ Node keyboard and mouse activity detector without root!
# Methods

## xinput_get_all_devices_id ( callback )
Get list of all xinput devices
Gets list of all xinput devices
### attributes
* callback - function - callback function

## new xinput_listener ( good_devices_id_list, callback, [optional] response_interval = 3000 )
Create new listener for devices
Creates new listener for devices
### attributes
* good_devices_id_list - array of numbers - list of devices id (you can get it from xinput_get_all_devices_id)
* callback - function - callback function
* response_interval - number - time interval for send events list to callback. **If set 0 - live mode**
* response_interval - number - time interval for sending list of events to callback. **If 0 is set, live mode is active**

## destroy ( )
Destroy all streams and clear class
Destroys all streams and clears class

# Info

## standard mode (if response_interval > 0 )
Every N seconds calls callback with events list
Calls callback with list of events every N seconds

## live mode (if response_interval === 0 )
When any event triggered it create new event list with this event and immediately call callback, for every event make new call
When any event triggers, it creates new event list with this event calls callback immediately. For new call is made for every event.


# Installing
Expand All @@ -41,7 +41,7 @@ xinput_get_all_devices_id((devices_id_list: number[])=> {
var listener = new xinput_listener(devices_id_list, (xinput_events_list: xinput_events_list)=> {
console.log('events!', xinput_events_list);
});
// Destroy after 10 sec
// Destroys listener after 10 sec
setTimeout(function () {
listener.destroy();
}, 10000);
Expand All @@ -55,7 +55,7 @@ xmkl.xinput_get_all_devices_id(function (devices_id_list) {
var listener = new xmkl.xinput_listener(devices_id_list, function (xinput_events_list) {
console.log('events!', xinput_events_list);
});
// Destroy after 10 sec
// Destroys listener after 10 sec
setTimeout(function () {
listener.destroy();
}, 10000);
Expand All @@ -70,7 +70,7 @@ import {xinput_events_list, xinput_get_all_devices_id, xinput_listener} from 'xi
xinput_get_all_devices_id((devices_id_list: number[])=> {
var listener = new xinput_listener(devices_id_list, (xinput_events_list: xinput_events_list)=> {
console.log('events!', xinput_events_list);
}, 0); // <- 0 is live mode!
}, 0); // <- 0 is set, live mode is active!
});
```
### JavaScript
Expand All @@ -80,6 +80,6 @@ xmkl.xinput_get_all_devices_id(function (devices_id_list) {
console.log('all', devices_id_list);
var listener = new xmkl.xinput_listener(devices_id_list, function (xinput_events_list) {
console.log('events!', xinput_events_list);
}, 0); // <- 0 is live mode!
}, 0); // <- 0 is set, live mode is active!
});
```
80 changes: 40 additions & 40 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ab433e

Please sign in to comment.