Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
linux-input-device
Advanced tools
Readme
Native addon to communicate with linux input devices.
Install with npm
:
$ npm install linux-input-device
new LinuxInputListener( String devicePath )
Creates a new LinuxInputListener instance.
path
A path to a linux input deviceEvent: state( Boolean state, Number keyCode, String keyKind )
Fired when a key state changes or when a key is queried.
state
True if the key is pressed, false otherwisekeyCode
Code of the key whose state has changedkeyKind
Category of the key.String[] LinuxInputListener.KEY_KINDS
Array containing all supported key kinds, like EV_KEY, EV_SW, or EV_LED.
LinuxInputListener.query( String keyKind, Number keyCode )
Query the current key. Also fires the state event.
keyCode
Code of the key whose state to querykeyKind
Category of the key. Must be one of the strings in LinuxInputListener.KEY_KINDSLinuxInputListener.close([Function callback()])
Closes the current device and invoke callback when the device is closed.
callback()
[optional] A callback functionvar LinuxInputListener = require('linux-input-device');
var SW_LID = 0x00;
var input = new LinuxInputListener('/dev/input/event0');
input.on('state', function(value, key, kind) {
console.log('State is now:', value, 'for key', key, 'of kind', kind);
});
input.on('error', console.error);
//start by querying for the initial state.
input.on('open' => input.query('EV_SW', SW_LID));
FAQs
A simple library to receive events in NodeJS when input events occur
The npm package linux-input-device receives a total of 28 weekly downloads. As such, linux-input-device popularity was classified as not popular.
We found that linux-input-device demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.