Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Getting keyboard input

    Development
    2
    2
    1304
    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
      croxis last edited by

      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
        hardcola last edited by

        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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy