This is a lightweight module for MagicMirror² to send key-inputs as notifications to active modules, or execute configurable actions.
In your terminal, go to your MagicMirror² Module folder and clone MMM-KeyInput:
cd ~/MagicMirror/modules
git clone https://github.com/SeeSharpSoft/MMM-KeyInput.git
cd ~/MagicMirror/modules/MMM-KeyInput
git pull
To use this module, add it to the modules array in the config/config.js
file:
{
module: "MMM-KeyInput",
config: {
active: true,
keyBindings: {
"ArrowLeft": "NOTIFICATION",
"ArrowRight": ["NOTIFICATION", { payload: true }],
"Enter": (module, keyEvent) => module.sendNotification("SOME_CUSTOM_EVENT", keyEvent);
}
}
}
Note: Do not add a position to this module.
Option | Possible values | Default | Description |
---|---|---|---|
active |
boolean |
false | Whether the overlay is active/visible |
keyBindings |
object |
{} | Custom actions to be performed on certain keypress |
By default, the overlay is not active/visible. Its visibility can be controlled by sending notifications.
Notification | Description |
---|---|
OVERLAY.SHOW |
Shows (activates) the overlay |
OVERLAY.HIDE |
Hides (deactivates) the overlay |
OVERLAY.ACTIVE |
Payload must contain true /false |
npm install
- Install devDependencies like ESLint.npm run lint
- Run linting and formatter checks.npm run lint:fix
- Fix linting and formatter issues.