Added pause-on-active
option
Windows only for now. When set to true, pauses mining when user touches mouse or keyboard.
This commit is contained in:
parent
8e3fec5768
commit
82830e359a
13 changed files with 57 additions and 6 deletions
|
@ -161,3 +161,16 @@ bool xmrig::Platform::isOnBatteryPower()
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Platform::isUserActive()
|
||||
{
|
||||
LASTINPUTINFO info;
|
||||
info.cbSize = sizeof(LASTINPUTINFO);
|
||||
|
||||
if (!GetLastInputInfo(&info)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return static_cast<int>(GetTickCount() - info.dwTime) < 60 * 1000;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue