Skip to content

maxart/cc.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cc.js

A JavaScript wrapper for CharaChorder's Serial API.

Features

  • Supports modern web browsers with Web Serial API.
  • Implements key CharaChorder Serial API commands.
  • Provides easy-to-use methods for common operations.

Usage

<script src="cc.js"></script>

<script>
document.getElementById('connectButton').addEventListener('click', async () => {
    const device = new CharaChorderDevice();

    try {
        await device.connect();
        console.log("Connected to device");

        const os = await device.getOperatingSystem();
        console.log("Operating System:", os);

        const keymap = await device.getKeymap();
        console.log("Keymap:", keymap);

        const chords = await device.listChords();
        console.log("Chords:", chords);

    } catch (error) {
        console.error("Error:", error);
    } finally {
        await device.disconnect();
        console.log("Disconnected from device");
    }
});
</script>

Requirements

  • Web browser with Web Serial API support (Chrome 89+, Edge 89+, Opera 76+)

Links

License

AGPL-3.0 license

Attribution

This project is based on the CharaChorder DeviceManager project. We are grateful to the original authors and contributors for their work.

About

A JavaScript wrapper for CharaChorder's Serial API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published