1.0.0 • Published 7 months ago

reveal.js-joycon-plugin v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

RevealJS - The Joy Con Plugin

Control your RevealJS presentation with a Joy Con !

Mapping is done for both the right and left joy cons, independently.

Heavily inspired by reveal.js-gamepad-plugin from bibixx

Installation

From NPM

npm install --save reveal.js-joycon-plugin

Once installed, you can include the plugin as an ES module:

import Reveal from 'reveal.js';
import RevealJoyCon from 'reveal.js-joycon-plugin';

const deck = new Reveal();
deck.initialize({
    // ...
    plugins: [
        // ...,
        RevealJoyCon
    ]
})

Key bindings

By default, the plugin is configured with the following key bindings :

LeftRightAction
RIGHTARight
DOWNBDown
UPXUp
LEFTYLeft
SRSRNext slide
SLSLPrevious slide
LRToggle overview
ZLZRQuit overview / Next slide
STICKSTICKToggle pointer
-+Toggle pause
CAPTUREHOMEToggle help

Configuration

You can configure the plugin with the following options :

// ...
plugins: [ /* ... */ ],
joycon: {
    type: 'right',   // or 'left', depending on the Joy Con you want to use, default is 'right'
    cooldown: 200,   // the time in ms between two actions, default is 300
    pointerSpeed: 10 // the speed of the pointer, default is 20
}

Development

  • Clone the repo
  • Install dependencies with npm install
  • Run the test app with npm start
    • The Reveal API is mocked, just open the console to verify inputs are correctly handled

Planned features

  • Customize key binding through config
  • Customize pointer appearance through config
1.0.0

7 months ago

0.0.1

7 months ago