Change declaration order of delay thread member in KeyDelay (#7206)

This commit is contained in:
Arjun Balgovind
2020-10-09 16:13:48 -07:00
committed by GitHub
parent 7fd5e18ef4
commit 8643bfc977

View File

@@ -63,7 +63,6 @@ private:
// Also checks for overflow conditions.
bool CheckIfMillisHaveElapsed(DWORD64 first, DWORD64 last, DWORD64 duration);
std::thread _delayThread;
bool _quit;
KeyDelayState _state;
@@ -86,6 +85,9 @@ private:
// Virtual Key provided in the constructor. Passed to callback functions.
DWORD _key;
// Declare _delayThread after all other members so that it is the last to be initialized by the constructor
std::thread _delayThread;
static const DWORD64 LONG_PRESS_DELAY_MILLIS = 900;
static const DWORD64 ON_HOLD_WAIT_TIMEOUT_MILLIS = 50;
};