From bb1cca04337ab840d6989540ba649155ed6fa398 Mon Sep 17 00:00:00 2001 From: velvettear Date: Mon, 28 Mar 2022 17:17:31 +0200 Subject: [PATCH] implement / fix combo timeout --- example_config.json | 2 +- libs/keyfilter.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/example_config.json b/example_config.json index bafaf44..f8672e5 100644 --- a/example_config.json +++ b/example_config.json @@ -4,7 +4,7 @@ "timestamp": "DD.MM.YYYY HH:mm:ss:SS" }, "combos": { - "delay": 5000 + "delay": 1000 }, "watchers": [ { diff --git a/libs/keyfilter.js b/libs/keyfilter.js index ecf271d..bd13b7f 100644 --- a/libs/keyfilter.js +++ b/libs/keyfilter.js @@ -239,13 +239,11 @@ class Keyfilter { return true; } hasComboTimedOut() { - return false; return global.config?.combos?.delay !== undefined && this.currentCombo?.timestamp !== undefined && - new Date().getTime() - this.currentCombo.timestamp > global.config?.combos?.dela; + new Date().getTime() - this.currentCombo.timestamp > global.config?.combos?.delay; } resetCurrentCombo() { - console.debug('resetting current combo...'); this.currentCombo = undefined; } isValid() {