Initial commit

This commit is contained in:
Gericom
2025-11-22 17:21:45 +01:00
commit 5d6f67c612
517 changed files with 63025 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#pragma once
#include "InputProvider.h"
/// @brief Input provider that wraps another input provider and adds key repetition on top of it.
class InputRepeater : public InputProvider
{
public:
InputRepeater(InputProvider* inputProvider, InputKey repeatMask, u16 firstRepeatDelay, u16 nextRepeatDelay)
: _inputProvider(inputProvider), _state(State::Idle)
, _frameCounter(0), _repeatMask(repeatMask)
, _firstRepeatDelayFrames(firstRepeatDelay)
, _nextRepeatDelayFrames(nextRepeatDelay) { }
void Update() override;
void Reset() override;
private:
enum class State
{
Idle,
FirstRepeat,
NextRepeat
};
InputProvider* _inputProvider;
State _state;
u16 _frameCounter;
InputKey _repeatMask;
u16 _firstRepeatDelayFrames;
u16 _nextRepeatDelayFrames;
};