diff --git a/src/dat/controllers/NumberControllerBox.js b/src/dat/controllers/NumberControllerBox.js index 462ebf25..7863b433 100644 --- a/src/dat/controllers/NumberControllerBox.js +++ b/src/dat/controllers/NumberControllerBox.js @@ -93,12 +93,30 @@ class NumberControllerBox extends NumberController { dom.bind(this.__input, 'blur', onBlur); dom.bind(this.__input, 'mousedown', onMouseDown); dom.bind(this.__input, 'keydown', function(e) { - // When pressing enter, you can be as precise as you want. - if (e.keyCode === 13) { - _this.__truncationSuspended = true; - this.blur(); - _this.__truncationSuspended = false; - onFinish(); + switch (e.key) { + case 'Enter': + { + // When pressing enter, you can be as precise as you want. + _this.__truncationSuspended = true; + this.blur(); + _this.__truncationSuspended = false; + onFinish(); + break; + } + case 'ArrowUp': + { + _this.setValue(_this.getValue() + _this.__impliedStep); + break; + } + case 'ArrowDown': + { + _this.setValue(_this.getValue() - _this.__impliedStep); + break; + } + default: + { + break; + } } });