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