Home Reference Source

NOTE

This is just a steno engine library and it does NOT work on its own. Please use something else such as Plover or wait for my full steno engine. Huge thanks to the openstenoproject for all their amazing work!

A stenography library that anyone can use and contribute to! It's only 7KB as of writing and took 4 days to complete first version.
Made By CrazyH2

Take a look at plover as this wouldn't be possible without them!
Plover | Ploverpad

Installation

Production Bundling

Just run the code below after installation:

sh npm run build <b>The code should appear in /dist when bundled!</b>

Usage

NODE:

const { GlobalKeyboardListener } = require("node-global-key-listener");

const { Kestrel } = require("../lib/engine");
const Dictionary = require("../assets/dict.json");

(async () => {
    const app = await Kestrel();

    var gkl = new GlobalKeyboardListener();
    gkl.addListener((e, down) => {
        if(!e.name.includes("MOUSE")) app.input.fromQwerty(e.state == 'DOWN', e.name);
    });

    await app.output.onData((data) => {
        console.log(data);
    });

    await app.dictionaries.load(Dictionary);
})();

WEB:

<script type="module">
  import { Kestrel } from "../dist/kestrel.js";

  const app = await Kestrel();

  document.addEventListener("keydown", (ev) => {
    app.input.fromQwerty(true, ev.name);
  });

  document.addEventListener("keyup", (ev) => {
    app.input.fromQwerty(false, ev.name);
  });

  await app.output.onData((data) => {
    console.log(data);
    document.querySelector("#content").innerHTML = data;
  });

  var dict = await (await fetch("../assets/dict.json")).json();

  await app.dictionaries.load(dict);
</script>


Contributing

All contributions will be looked at and most likely accepted when I have time to look at them. Please make sure what you contribute actually applies to the project, and if not see if it would work elsewhere. For example Plover.

Dictionaries

We support most dictionaries that will work with Plover and other steno engines, so just import one you used to or learn one. Just make sure the file is in the format JSON otherwise the dictionary won't work with Kestrel.js. I personally recommend lapwing thory which you can learn online for free.

Making Addons

Ask for help or look at the source code when your stuck!

Example:

class AddonExample {
    constructor(convert) {
        this.isAddon = true;
        this.convert = convert;
    };

    onLoad() {

    };

    onUnload() {

    };

    onKeyDown(key) {

    };

    onKeyUp(key) {

    };

    async onChord(chord, output, next) {
        return next(); // Skip this addon
    };
};

module.exports = { AddonExample };

Macros

Just ask if the code confuses you!

Example:

const MacroExample = {
  name: "base",

  "CAPS-LOCK:ON": () => {
    return "Hello, world!"
  }
}

module.exports = { MacroExample };


License

Distributed under a Custom License. See LICENSE for more information.

Credits

<b>- Huge thanks to Openstenoproject an the steno community for allowing this project to exist.
</b> <b>- Ploverpad was a huge help in parsing CTE/RTF for steno!</b> <b>- Main Dev: CrazyH2</b>