Socket
Socket
Sign inDemoInstall

presenter-keys

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    presenter-keys

Presenter keys made easy


Version published
Maintainers
1
Created

Readme

Source

presenter-keys

Tiny no-dependency library that allows you to easily bind actions to the keys of presenters like e.g. the Logitech R800 Presenter.

Those kinds of presenters are basically keyboards that will send the following key codes:

  • Previous => PageUp (33)
  • Next => PageDown (34)
  • Run => Alternating between F5 (116) and Escape (27)
  • Blank => A simple dot (190)

Direct usage

Simply import the presenterKeys function module and call it with the callback functions you want to attach to the different keys:


<script type="module">
    import { presenterKeys } from "https://unpkg.com/@defaude/presenter-keys";

    presenterKeys({
        prev: () => console.log('prev'),
        next: () => console.log('next'),
        run: () => console.log('run'),
        blank: () => console.log('blank')
    });
</script>

Based on the available keys, the four available callbacks are prev, next, run and blank. You don't need to pass all four callbacks - maybe you just need prev and next in most cases.

Installation as npm package

This is published as npm package, so you can just

npm install @defaude/presenter-keys

and use it in your code

import { presenterKeys } from '@defaude/presenter-keys';

presenterKeys({ /* ... */ });

FAQs

Last updated on 02 Oct 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc