Key repeats, with OS delay (#168)

This commit is contained in:
Tim Mickel 2016-09-12 13:52:44 -04:00 committed by GitHub
parent 91cdec1547
commit c357a62005

View file

@ -59,16 +59,14 @@ Keyboard.prototype.postData = function (data) {
// If not already present, add to the list.
if (index < 0) {
this._keysPressed.push(data.keyCode);
this.runtime.startHats('event_whenkeypressed',
{
}
// Always trigger hats, even if it was already pressed.
this.runtime.startHats('event_whenkeypressed', {
'KEY_OPTION': this._keyCodeToScratchKey(data.keyCode)
});
this.runtime.startHats('event_whenkeypressed',
{
this.runtime.startHats('event_whenkeypressed', {
'KEY_OPTION': 'any'
});
}
} else if (index > -1) {
// If already present, remove from the list.
this._keysPressed.splice(index, 1);