Skip to content

Commit

Permalink
chore: rename examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Apr 7, 2021
1 parent 373e6b4 commit 4da3a49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions examples/xkeys.js → examples/basic-log-all-events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const { XKeysWatcher } = require('../')
const { XKeysWatcher } = require('../dist') // require('xkeys')

// Set up the watcher for xkeys
/*
This example connects to any conncted x-keys panel and logs
whenever a button is pressed or analog thing is moved
*/


// Set up the watcher for xkeys:
const watcher = new XKeysWatcher()

watcher.on('connected', (xkeysPanel) => {
Expand Down
7 changes: 6 additions & 1 deletion examples/xkeys-manual.ts → examples/manually-connect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { XKeys } from 'xkeys'

// Connect to any xkeys-panel:
/*
This example shows how to use XKeys.setupXkeysPanel()
directly, instead of going via XKeysWatcher()
*/

// Connect to an xkeys-panel:
XKeys.setupXkeysPanel()
.then((xkeysPanel) => {
xkeysPanel.on('disconnected', () => {
Expand Down

0 comments on commit 4da3a49

Please sign in to comment.