mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-24 17:18:00 +08:00
1533c9315f
* Enable app specific shortcut remapping * Fixed lowercase function call * Add test file * Moved GetForegroundProcess to II and added tests * Fixed runtime error while testing due to heap allocation across dll boundary * Renamed function * Remove unused code * Changed process checking step to include substrings * Changed back to exact match included match without file extension
22 lines
575 B
C++
22 lines
575 B
C++
#include "pch.h"
|
|
#include "Input.h"
|
|
#include <keyboardmanager/common/Helpers.h>
|
|
|
|
// 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);
|
|
}
|
|
|
|
// Function to get the foreground process name
|
|
void Input::GetForegroundProcess(_Out_ std::wstring& foregroundProcess)
|
|
{
|
|
foregroundProcess = KeyboardManagerHelper::GetCurrentApplication(false);
|
|
}
|