27 lines
719 B
C++
27 lines
719 B
C++
#ifndef HUMANIZERKEYHANDLER_H
|
|
#define HUMANIZERKEYHANDLER_H
|
|
|
|
#include "keyhandler.h"
|
|
#include <memory>
|
|
|
|
class HumanizerKeyHandler : public KeyHandler
|
|
{
|
|
public:
|
|
HumanizerKeyHandler(std::unique_ptr<KeyHandler> keyHandler);
|
|
virtual ~HumanizerKeyHandler() override { }
|
|
|
|
virtual void Key(SpecialKey key, KeyModifiers mods = KeyModifiers::KM_NONE) override;
|
|
virtual void Key(char key, KeyModifiers mods = KeyModifiers::KM_NONE) override;
|
|
|
|
unsigned minDelay = 50;
|
|
unsigned maxDelay = 150;
|
|
bool insertMistakes = true;
|
|
|
|
private:
|
|
void InsertDelay(char currentKey, SpecialKey currentKeySpecial, KeyModifiers mods);
|
|
|
|
std::unique_ptr<KeyHandler> m_keyHandler;
|
|
};
|
|
|
|
#endif // HUMANIZERKEYHANDLER_H
|