If I want to check if enter
is pressed, I will do something like:
addEventListener('keypress', function (e) {
if (e.key === 'Enter') alert('You pressed enter!');
});
So, will that same code work on a Mac, will it register mac's return
as enter
?