05-27-2020 10:54
05-27-2020 10:54
So, I basically have a counting app, and I've got pretty far for not knowing a single thing about how to do it. However, I have a combo-button thing, and that's supposed to let the side buttons be able to be the buttons on screen. However, my event listener only takes the button on screen input, but not the side button. If anybody could help, that would be great!
I'll post my code here:
import document from "document";
const score = document.getElementById("score");
const btntr = document.getElementById("btntr");
const counter = 0;
btntr.addEventListener("click", () => {
counter = counter + 1;
score.text = `${counter} `;
console.log("TOP RIGHT!");
});
Answered! Go to the Best Answer.
05-27-2020 13:02 - edited 05-27-2020 13:26
05-27-2020 13:02 - edited 05-27-2020 13:26
Ok. I see. It is still beyond me a bit, but here is what I would do.
1) Make sure I am setting up the buttons correctly. You need to use the Combo Button class, not just a regular button positioned on the side. The button needs an entry in 3 files.
2) I would then make certain I was using the primary and secondary buttons (the two right-hand ones).
If it still did not work, I would bypass the software buttons altogether and try just getting a hardware button to work first. Then integrating the two.
05-27-2020 12:02 - edited 05-27-2020 12:04
05-27-2020 12:02 - edited 05-27-2020 12:04
When you say side buttons, do you mean the corner combo buttons, or the hardware buttons on the Versa 1 and Ionic? I can help with the former, but the latter is a bit beyond me.
05-27-2020 12:20
05-27-2020 12:20
05-27-2020 13:02 - edited 05-27-2020 13:26
05-27-2020 13:02 - edited 05-27-2020 13:26
Ok. I see. It is still beyond me a bit, but here is what I would do.
1) Make sure I am setting up the buttons correctly. You need to use the Combo Button class, not just a regular button positioned on the side. The button needs an entry in 3 files.
2) I would then make certain I was using the primary and secondary buttons (the two right-hand ones).
If it still did not work, I would bypass the software buttons altogether and try just getting a hardware button to work first. Then integrating the two.
05-27-2020 16:03
05-27-2020 16:03
Okay. I'll try that, and get back to this thread in a moment.
05-27-2020 16:08
05-27-2020 16:08
So far, this seems to work. Now to my next problem...
Thanks!
05-28-2020 05:23
05-28-2020 05:23
Excellent. Good luck and have fun.