mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 02:34:42 +00:00
Reuse retropad poll fn
This commit is contained in:
parent
d922e58278
commit
dceb6f9993
1 changed files with 4 additions and 2 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue