blob: 0195c588a7f0c57ff2ced75991542e61d4484a66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "ui_base.h"
#include "system_headers.h"
namespace cru::ui
{
bool IsKeyDown(const int virtual_code)
{
const auto result = ::GetKeyState(virtual_code);
return (static_cast<unsigned short>(result) & 0x8000) != 0;
}
bool IsKeyToggled(const int virtual_code)
{
const auto result = ::GetKeyState(virtual_code);
return (static_cast<unsigned short>(result) & 1) != 0;
}
}
|