JavaScript30
JavaScript30 copied to clipboard
Make changes to `audio` and `div` to make script compatible with `event.code`
event.keyCode
is deprecated and may be incompatible in future browser updates.
Additionally, I've found that using event.keyCode
sometimes prevent sound from being played properly when pressed repeatedly (using macOS 12, Firefox 101), where the sound would not play if you repeatedly press the keystroke. event.code
does not have such problem
In my opinion this should be implemented since the change is minimal and the user will be warned to use a different method above <script>
, since the keystroke id capture used in the video has been deprecated. Using this method in the future would not guarantee that the script would run properly.
Duplicate of #466