bsnes-libretro/hiro/windows/mouse.cpp
byuu 903d1e4012 v107.8
* GB: integrated SameBoy v0.12.1 by Lior Halphon
* SFC: added HG51B169 (Cx4) math tables into bsnes binary
2019-07-17 21:11:46 +09:00

23 lines
484 B
C++
Executable File

#if defined(Hiro_Mouse)
namespace hiro {
auto pMouse::position() -> Position {
POINT point{};
GetCursorPos(&point);
return {point.x, point.y};
}
auto pMouse::pressed(Mouse::Button button) -> bool {
switch(button) {
case Mouse::Button::Left: return GetAsyncKeyState(VK_LBUTTON) & 0x8000;
case Mouse::Button::Middle: return GetAsyncKeyState(VK_MBUTTON) & 0x8000;
case Mouse::Button::Right: return GetAsyncKeyState(VK_RBUTTON) & 0x8000;
}
return false;
}
}
#endif