Skip to content

Commit

Permalink
Fix keyCodes (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
SthephanShinkufag committed Dec 3, 2021
1 parent f6fca68 commit 8ca77c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bytebeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const bytebeat = new class {
this.controlVolume = document.getElementById('control-volume');
this.timeCursor = document.getElementById('canvas-timecursor');
this.controlCounter.oninput = this.controlCounter.onkeydown = e => {
if(e.keyCode === 13 /* ENTER */) {
if(e.key === 'Enter') {
this.controlCounter.blur();
this.togglePlay(true);
return;
Expand All @@ -200,7 +200,7 @@ const bytebeat = new class {
this.editorElem = document.getElementById('editor');
this.editorElem.oninput = () => this.setFunction();
this.editorElem.onkeydown = e => {
if(e.keyCode === 9 /* TAB */ && !e.shiftKey && !e.altKey && !e.ctrlKey) {
if(e.key === 'Tab' && !e.shiftKey && !e.altKey && !e.ctrlKey) {
e.preventDefault();
const el = e.target;
const { value, selectionStart } = el;
Expand Down

0 comments on commit 8ca77c3

Please sign in to comment.