switch for keyCodes

This commit is contained in:
jberg 2018-05-15 19:01:51 -07:00 committed by Jordan Eldredge
parent d9dc12477c
commit ad9d17ad8e

View file

@ -109,12 +109,16 @@ class MilkdropWindow extends React.Component {
}
}
_handleKeyboardInput(e) {
if (e.which === 32) { // spacebar
this._nextPreset(USER_PRESET_TRANSITION_SECONDS);
} else if (e.which === 8) { // backspace
this._prevPreset(0);
} else if (e.which === 72) { // H
this._nextPreset(0);
switch (e.keyCode) {
case 32: // spacebar
this._nextPreset(USER_PRESET_TRANSITION_SECONDS);
break;
case 8: // backspace
this._prevPreset(0);
break;
case 72: // H
this._nextPreset(0);
break;
}
}
_nextPreset(blendTime) {