2013-03-15 13:11:33 +00:00
|
|
|
namespace phoenix {
|
|
|
|
|
2012-01-15 08:29:57 +00:00
|
|
|
Position pMouse::position() {
|
2013-03-15 13:11:33 +00:00
|
|
|
POINT point = {0};
|
2012-01-15 08:29:57 +00:00
|
|
|
GetCursorPos(&point);
|
2013-03-15 13:11:33 +00:00
|
|
|
return {point.x, point.y};
|
2012-01-15 08:29:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool pMouse::pressed(Mouse::Button button) {
|
|
|
|
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;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|