Skip to content

jheyman/MMM-Keyboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMM-Keyboard

Fork from the original excellent MMM-Keyboard module for the MagicMirror² that creates a virtual keyboard to be used to send commands or text to other modules

Example image

Installing

Step 1 - Install the module

cd ~/MagicMirror/modules
git clone https://github.com/jheyman/MMM-Keyboard.git
cd MMM-Keyboard
npm install

Step 2 - Add module to config.js

Add this configuration into your config.js file

{
    module: "MMM-Keyboard",
    position: "fullscreen_above",
    config: {
        style: "default",
    }
}

Dependencies

Working with the Keyboard

Opening the keyboard

The keyboard works with MagicMirror's notification system. You can broadcast notifications from another module using the following parameters

this.sendNotification("KEYBOARD", {
    key: "uniqueKey",
    style: "default"
});

The payload of the notification must be an object containing two parameters: key: You can use any unique key, it is advised to use the module name. MMM-Keyboard will take the key and send it back for the module to understand it. style: Use "default" or "numbers" here,

Receiving data

As soon as you hit the "SEND!"-Button the keyboard sends back the written content using the format

this.sendNotification("KEYBOARD_INPUT", {
    key: "uniqueKey",
    message: "test"
});

You can fetch this message by checking for the key component. Here an example:

notificationReceived : function (notification, payload) {
    if (notification == "KEYBOARD_INPUT" && payload.key === "uniqueKey") {
        console.log(payload.message);
    }
},

About

A MagicMirror module displaying a virtual keyboard for touch devices. The keyboard can be used to send any input to other modules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.2%
  • CSS 19.8%