All Projects → AkashaCoin → hidstream

AkashaCoin / hidstream

Licence: MIT license
Streaming HID events in Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hidstream

react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (-26.92%)
Mutual labels:  keyboard, keyboard-events
Chordly
Chordly is a javascript library that may be used to detect and act upon key sequences entered by a user.
Stars: ✭ 14 (-73.08%)
Mutual labels:  keyboard, keyboard-events
pi400kb
Raw HID keyboard forwarder to turn the Pi 400 into a USB keyboard
Stars: ✭ 182 (+250%)
Mutual labels:  keyboard, hid
global-keypress
Global key press event emitter.
Stars: ✭ 25 (-51.92%)
Mutual labels:  keyboard, keyboard-events
Ucr
Universal Control Remapper [Alpha]
Stars: ✭ 399 (+667.31%)
Mutual labels:  keyboard, hid
Karabiner Driverkit Virtualhiddevice
Stars: ✭ 108 (+107.69%)
Mutual labels:  keyboard, hid
re-pressed
re-pressed is a clojurescript library that handles keyboard events for re-frame applications.
Stars: ✭ 150 (+188.46%)
Mutual labels:  keyboard, keyboard-events
openinput
Open source firmware for input devices
Stars: ✭ 43 (-17.31%)
Mutual labels:  keyboard, hid
ember-key-manager
A service for (un)binding keyboard up and down events.
Stars: ✭ 39 (-25%)
Mutual labels:  keyboard, keyboard-events
Pxt Bluetooth Keyboard
BLE HID Keyboard module for micro:bit
Stars: ✭ 44 (-15.38%)
Mutual labels:  keyboard, hid
Keyboardjs
A JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts.
Stars: ✭ 1,881 (+3517.31%)
Mutual labels:  keyboard, keyboard-events
KeyBoardTool
Keyboard key detection software realized by Qt(Qt实现的键盘按键检测软件)
Stars: ✭ 35 (-32.69%)
Mutual labels:  keyboard
joyconpi
An attempt at emulating a Nintendo Switch Joy-Con controller with a Raspberry Pi
Stars: ✭ 24 (-53.85%)
Mutual labels:  hid
PickerButton
PickerButton is subclass of UIButton that presents UIPickerView in UIKeyboard.
Stars: ✭ 41 (-21.15%)
Mutual labels:  keyboard
keyboard
A terrible terrible soft-keyboard that randomises keys on every press.
Stars: ✭ 17 (-67.31%)
Mutual labels:  keyboard
mx3000control
Perixx MX-3000 mouse unofficial configuration tool for Linux
Stars: ✭ 20 (-61.54%)
Mutual labels:  hid
steno
Embedded steno firmware + custom steno PCBs
Stars: ✭ 47 (-9.62%)
Mutual labels:  keyboard
FormToolbar
Simple, movable and powerful toolbar for UITextField and UITextView.
Stars: ✭ 85 (+63.46%)
Mutual labels:  keyboard
ES-Timer
A USB timer powered by Digispark ATtiny85 according to 🍅 pomodoro time management technique
Stars: ✭ 45 (-13.46%)
Mutual labels:  hid
KeyboardLayoutHelper
Keyboard layout constraint class for iOS written in Swift to help adapt UIView to the appearing keyboard, so textfields don't get lost underneath it'.
Stars: ✭ 17 (-67.31%)
Mutual labels:  keyboard

HIDSTREAM

Streaming HID Events in Node.js

Wraps node-hid with several parsers for common HID devices, specifically, keyboard-like devices.

Data parsers are available for:

  • raw: passes the data as reported by node-hid.
  • keyboard: for keyboard-like devices.
  • newline: for keyboard-like devices where events are emitted on new-lines. (e.g. many barcode scanners, etc.)

Example:

var hid = require('hidstream');
var dev = new hid.device('0001:001:00', { parser : hid.parser.keyboard });

dev.on("data", function(dat) {
    console.log(dat); // easily consumed data format!
});

Sample HID Data Events for the parser:

The user has pressed Ctrl + Alt + Del

{
    modifiers : {
        l_shift :   false,
        l_control : true,
        l_alt :     true,
        l_meta :    false,
        r_ctrl :    false,
        r_shift :   false,
        r_alt :     false,
        r_meta :    false
    },
    keyCodes : [
        76
    ],
    keyChars : [],
    errorStatus : false
}

The user has pressed w, a, s & d (simultaneously (why? I don't know))

{
    modifiers : {
        l_shift :   false,
        l_control : false,
        l_alt :     false,
        l_meta :    false,
        r_ctrl :    false,
        r_shift :   false,
        r_alt :     false,
        r_meta :    false
    },
    keyCodes : [
        26, 4, 22, 7
    ],
    charCodes : [
        'w', 'a', 's', 'd'
    ],
    errorStatus: false
}

Convenience Methods

The data packet has additional convenience methods, shift(), control(), alt(), and meta() which return true if either the left or right of each key is pressed. The function mod() returns true if any of the modifier keys is pressed.

Additionally, empty() returns true if there is no modifier or key currently down.

Status

Right now, hidstream is only parsing keyboard events, and has no awareness of HID feature reports.

After keyboard events are being parsed properly (and fully), I will add support for feature reports and other devices such as mice.

Contributions

Significant refactor contributed by @kubat

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].