#pragma once #include "stdafx.h" #include #include #include "../Utilities/SimpleLock.h" #include "../Utilities/Timer.h" #include "EmulationSettings.h" class Console; class ShortcutKeyHandler { private: shared_ptr _console; std::thread _thread; atomic _stopThread; SimpleLock _lock; int _keySetIndex; vector _pressedKeys; vector _lastPressedKeys; bool _isKeyUp; bool _keyboardMode; shared_ptr _runSingleFrameRepeatTimer; bool _repeatStarted; std::unordered_set _keysDown[2]; std::unordered_set _prevKeysDown[2]; void CheckMappedKeys(); bool IsKeyPressed(EmulatorShortcut key); bool IsKeyPressed(KeyCombination comb); bool IsKeyPressed(uint32_t keyCode); bool DetectKeyPress(EmulatorShortcut key); bool DetectKeyRelease(EmulatorShortcut key); void ProcessRunSingleFrame(); public: ShortcutKeyHandler(shared_ptr console); ~ShortcutKeyHandler(); void ProcessKeys(); };