Skip to content

A tiny library to display a reactive macbook keyboard on screen.

License

Notifications You must be signed in to change notification settings

AmBeta/macbook-keyboard

Repository files navigation

Macbook Keyboard

A tiny library to display a reactive macbook keyboard on screen.

screenshot

Feature

  • vanilla, no framework required
  • no dependency
  • dark/light theme
  • i18n friendly

Usage

// create an instance by invoking the factory method
const kbd = MacbookKeyboard({ theme: 'dark' });
// toggle the pressed status of key 'Shift'
kbd.toggle('Shift');
// get the pressed status of key 'Shift'
kbd.check('Shift');
// reset pressed status for all keys
kbd.clear();

Options

{
  // "dark", "light"
  "theme": "dark",
  // display label on each key
  "showLabel": true,
  // map key settings
  "keyMappings": {
    "Enter": {
      "label": ["enter", "回车"],
    },
  },
}

Thanks

This project is inspired by react-mac-keyboard.

License

MIT

About

A tiny library to display a reactive macbook keyboard on screen.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published