I have a program where I have several clickable buttons as well as a reason to click enter. Issue is, if I click a handful of the buttons with the mouse and then click the enter key on my keyboard, it does what enter should do and it also acts as though I had clicked the last button that I clicked one more time. I want the clicking to only be done with the mouse and have the enter key not be able to click buttons. How do I do this? code Here is how I am currently making the buttons clickable and getting the input of the keyboard.
By clicking on the tile button, it gets focus. Hence, subsequent enter triggers the button.
You could "un-focus" the button:
// tile is a reference to the button, as per your question
tile.addEventListener('click', (evt) => {
// un-focus
tile.blur();
// do some stuff
});