• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Getting keyboard input

Scheduled Pinned Locked Moved Development
2 Posts 2 Posters 1.7k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    croxis
    last edited by Aug 1, 2016, 10:19 PM

    I’ve started working on a set of modules where a user can chat with the mirror via keybaord input and get responses from some kind of neural network ai. I’m running into a brick wall on getting keyboard input. Right now I’m using an inputbox but keypresses don’t seem to show up in it. I know a little python but webdev and javascript is new to me. Here is the very basic code I have so far and thanks for the help!

    Module.register("keyboard", {
        getDom: function() {
            var wrapper = document.createElement("div");
            var form = document.createElement("form");
            var inputbox = document.createElement("input");
            inputbox.setAttribute("type", "text");
            form.appendChild(inputbox);
            wrapper.appendChild(form);
            Log.info(this.name + " worked.");
            return wrapper;
        }
    });
    
    1 Reply Last reply Reply Quote 0
    • H Offline
      hardcola
      last edited by Feb 6, 2018, 12:48 PM

      Did you find a solution? I will make a new post because I have the same issue.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Sam, technical setup by Karsten.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy