npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

specialkey-emulator

v4.1.0

Published

Emulate special keys (e.g. brightness, play/pause, increase volume) by emitting low-level global keyboard events - using NodeJS.

Downloads

57

Readme

specialkey-emulator


Emulate special keys (e.g. brightness, play/pause, increase volume) by emitting low-level global keyboard events - using NodeJS.

Contents

  1. Supported Platforms
  2. Requirements
  3. Roadmap
  4. Installation
  5. Usage
  6. API
  7. List of Special Key Names
  8. Author
  9. License

Supported Platforms

Currently OSX only (see Roadmap).
Tested on OSX 10.13 and 10.14.

Requirements

Node 10.0.0+

Roadmap

Installation

npm install specialkey-emulator --save

Usage

To trigger a key, simply require the module and directly call it with the name of the key to be triggered. See List of Special Key Names for a list of currently supported keys.

Simple usage

specialkey = require('specialkey-emulator');

specialkey('NX_KEYTYPE_ILLUMINATION_DOWN')

Callback usage

specialkey = require('specialkey-emulator');

specialkey('NX_KEYTYPE_ILLUMINATION_DOWN', function (err, result) {
    if (err) {
        return console.log('Error', err);
    }
    console.log('Key triggered', result);
})

API

Overview

This module directly exports itself as a function:

require('specialkey-emulator')(keyName, callback)

Parameters

It takes the following parameters:

  • keyName (String) - Name of the key to be triggered. See List of Special Key Names.
  • callback (Function) - Called after trying to trigger the special key.
    • error (Error) - Error
    • result (Number) - Internal code of the key which was called.

List of Special Key Names

OSX

  • Reference: Darwin Keyboard Events @ opensource.apple.com
  • Names
    • NX_KEYTYPE_SOUND_UP
    • NX_KEYTYPE_SOUND_DOWN
    • NX_KEYTYPE_BRIGHTNESS_UP
    • NX_KEYTYPE_BRIGHTNESS_DOWN
    • NX_KEYTYPE_CAPS_LOCK
    • NX_KEYTYPE_HELP
    • NX_KEYTYPE_POWER_KEY
    • NX_KEYTYPE_MUTE
    • NX_KEYTYPE_UP_ARROW_KEY
    • NX_KEYTYPE_DOWN_ARROW_KEY
    • NX_KEYTYPE_NUM_LOCK
    • NX_KEYTYPE_CONTRAST_UP
    • NX_KEYTYPE_CONTRAST_DOWN
    • NX_KEYTYPE_LAUNCH_PANEL
    • NX_KEYTYPE_EJECT
    • NX_KEYTYPE_VIDMIRROR
    • NX_KEYTYPE_PLAY
    • NX_KEYTYPE_NEXT
    • NX_KEYTYPE_PREVIOUS
    • NX_KEYTYPE_FAST
    • NX_KEYTYPE_REWIND
    • NX_KEYTYPE_ILLUMINATION_UP
    • NX_KEYTYPE_ILLUMINATION_DOWN
    • NX_KEYTYPE_ILLUMINATION_TOGGLE

Author

sidneys.github.io 2018

License

MIT