blob: c91fcd7be4e039818e2d28fbe0f48d56ea6b1199 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include "ui_base.hpp"
#include "system_headers.hpp"
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;
}
bool IsAnyMouseButtonDown()
{
return IsKeyDown(VK_LBUTTON) || IsKeyDown(VK_RBUTTON) || IsKeyDown(VK_MBUTTON);
}
}
|