Skip to content

Commit

Permalink
Shift + ⬆️ / ⬇️ == 10x the value ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
matheuss committed Oct 6, 2016
1 parent 93922a2 commit f7d4e39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/renderer/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ document.addEventListener('DOMContentLoaded', () => {
}

function handleKeyDown(event) {
const multiplier = event.shiftKey ? 10 : 1;
const parsedValue = parseInt(this.value, 10);
if (event.keyCode === 38) { // up
this.value++;
this.value = parsedValue + (1 * multiplier); // eslint-disable-line no-implicit-coercion
this.oninput();
} else if (event.keyCode === 40) { // down
this.value--;
this.value = parsedValue - (1 * multiplier); // eslint-disable-line no-implicit-coercion
this.oninput();
}
}
Expand Down

0 comments on commit f7d4e39

Please sign in to comment.