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;
}
});