diff --git a/examples/xkeys.js b/examples/basic-log-all-events.js similarity index 87% rename from examples/xkeys.js rename to examples/basic-log-all-events.js index 41b531b..1dacc5d 100644 --- a/examples/xkeys.js +++ b/examples/basic-log-all-events.js @@ -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) => { diff --git a/examples/xkeys-manual.ts b/examples/manually-connect.js similarity index 83% rename from examples/xkeys-manual.ts rename to examples/manually-connect.js index bd680d7..702628b 100644 --- a/examples/xkeys-manual.ts +++ b/examples/manually-connect.js @@ -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', () => {