From dceb6f9993456533ae94cd80abc53a6932594c3d Mon Sep 17 00:00:00 2001 From: Sergey Stepanov Date: Mon, 22 Apr 2024 11:45:07 +0300 Subject: [PATCH] Reuse retropad poll fn --- web/js/input/retropad.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/js/input/retropad.js b/web/js/input/retropad.js index e841dea65..6e39c69f2 100644 --- a/web/js/input/retropad.js +++ b/web/js/input/retropad.js @@ -5,7 +5,7 @@ import { import {KEY} from 'input' import {log} from 'log'; -const pollingIntervalMs = 4; +const pollingIntervalMs = 5; let controllerChangedIndex = -1; // Libretro config @@ -91,8 +91,10 @@ const _getState = () => { return controllerEncoded.slice(0, controllerChangedIndex + 1); } +const _poll = poll(pollingIntervalMs, sendControllerState) + export const retropad = { - poll: poll(pollingIntervalMs, sendControllerState), + poll: _poll, setKeyState, setAxisChanged, }