Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Commit

Permalink
Update demo.js, remove node_module from repo, add package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Mar 8, 2014
1 parent a806558 commit 37ec5e5
Show file tree
Hide file tree
Showing 67 changed files with 58 additions and 5,952 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,42 @@ Quick & dirty keyboard keylogger for NodeJS & Linux

Inspired from http://nodebits.org/linux-joystick

Install
-------

```
npm install git+https://github.com/Bornholm/node-keyboard.git
```

Usage
-----

See demo.js

var Keyboard = require('./keyboard.js');
```javascript
var Keyboard = require('./keyboard.js');

var k = new Keyboard('event2'); // 'event2' is the file corresponding to my keyboard in /dev/input/
k.on('keyup', console.log);
k.on('keydown', console.log);
k.on('keypress', console.log);
var k = new Keyboard('event2'); // 'event2' is the file corresponding to my keyboard in /dev/input/
k.on('keyup', console.log);
k.on('keydown', console.log);
k.on('keypress', console.log);
k.on('error', console.error);
```

Events

{
timeS: 1347572085, // Timestamp ( Seconds part )
timeMS: 741381, // Timestamp ( Microseconds part )
keyCode: 17, // Keyboard code
keyId: 'KEY_W', // Key ID /!\ Qwerty layout !
type: 'keypress', // Event type
dev: 'event2' // Device
}


Dependencies
------------

ref - https://github.com/TooTallNate/ref

npm install ref
```javascript
{
timeS: 1347572085, // Timestamp ( Seconds part )
timeMS: 741381, // Timestamp ( Microseconds part )
keyCode: 17, // Keyboard code
keyId: 'KEY_W', // Key ID /!\ Qwerty layout !
type: 'keypress', // Event type
dev: 'event2' // Device
}
```

Licence
-------

MIT
6 changes: 4 additions & 2 deletions demo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
var Keyboard = require('./keyboard.js');


var k = new Keyboard('event2'); // 'event2' is the file corresponding to my keyboard in /dev/input/
k.on('keyup', console.log);
k.on('keydown', console.log);
k.on('keypress', console.log);
k.on('keypress', console.log);

k.on('error', console.error); // Something wrent wrong, keyboard disconnected or something

5 changes: 0 additions & 5 deletions node_modules/ref/.npmignore

This file was deleted.

5 changes: 0 additions & 5 deletions node_modules/ref/.travis.yml

This file was deleted.

153 changes: 0 additions & 153 deletions node_modules/ref/History.md

This file was deleted.

Loading

0 comments on commit 37ec5e5

Please sign in to comment.