05-27-2020 16:21
05-27-2020 16:21
Right now I have an app that has numbers and if a button is clicked, the number goes up (btntr) or down (btnbr). How can I get it so that the physical side buttons do the same thing as the on screen buttons?
I've posted another like this, but kind of different.
I'll post what code I have here:
import document from "document";
var totalscore = 0;
const hole = document.getElementById("hole");
const btnbl = document.getElementById("btnbl");
const counter2 = 1
btnbl.addEventListener("click", () => {
counter2 = counter2 + 1;
hole.text = `${counter2} `;
console.log("BOTTOM LEFT");
counter = 0;
})
import document from "document";
btntr.onclick = function(e) {
console.log("Key pressed: " + e.key);
counter = counter + 1;
score.text = `${counter} `;
}
05-27-2020 16:23
05-27-2020 16:23
I guess my question is how can I get a response from a single physical button, as to any button in my code sample above?
05-31-2020 16:41
05-31-2020 16:41
If you use Combo buttons the activate event will work with both physical and touch screen actions