Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mixal_bl4 committed Sep 25, 2016
0 parents commit c24f667
Show file tree
Hide file tree
Showing 9 changed files with 1,257 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Node template
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Typings directory
typings
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# xinput-mouse-key-logger
Node keyboard and mouse activity detector without root!

# Methods

## xinput_get_all_devices_id ( callback )
Get 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
### 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**

## destroy ( )
Destroy all streams and clear class

# Info

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

## 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


# Installing
`npm install xinput-mouse-key-logger`

# Using

## Static mode
### TypeScript
```typescript
import {xinput_events_list, xinput_get_all_devices_id, xinput_listener} from 'xinput-mouse-key-logger';

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
setTimeout(function () {
listener.destroy();
}, 10000);
});
```
### JavaScript
```javascript
const xmkl = require('xinput-mouse-key-logger');
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);
});
// Destroy after 10 sec
setTimeout(function () {
listener.destroy();
}, 10000);
});
```

## LIVE mode
### TypeScript
```typescript
import {xinput_events_list, xinput_get_all_devices_id, xinput_listener} from 'xinput-mouse-key-logger';

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!
});
```
### JavaScript
```javascript
const xmkl = require('xinput-mouse-key-logger');
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!
});
```
179 changes: 179 additions & 0 deletions index.js

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

1 change: 1 addition & 0 deletions index.js.map

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

Loading

0 comments on commit c24f667

Please sign in to comment.