2020-06-12 04:07:46 +08:00
|
|
|
#include "pch.h"
|
|
|
|
#include "Input.h"
|
2020-07-07 07:45:53 +08:00
|
|
|
#include <keyboardmanager/common/Helpers.h>
|
2020-06-12 04:07:46 +08:00
|
|
|
|
|
|
|
// Function to simulate input
|
|
|
|
UINT Input::SendVirtualInput(UINT cInputs, LPINPUT pInputs, int cbSize)
|
|
|
|
{
|
|
|
|
return SendInput(cInputs, pInputs, cbSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Function to get the state of a particular key
|
|
|
|
bool Input::GetVirtualKeyState(int key)
|
|
|
|
{
|
|
|
|
return (GetAsyncKeyState(key) & 0x8000);
|
|
|
|
}
|
2020-07-07 07:45:53 +08:00
|
|
|
|
|
|
|
// Function to get the foreground process name
|
|
|
|
void Input::GetForegroundProcess(_Out_ std::wstring& foregroundProcess)
|
|
|
|
{
|
|
|
|
foregroundProcess = KeyboardManagerHelper::GetCurrentApplication(false);
|
|
|
|
}
|