mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-03-14 00:49:53 -04:00
SDL2: Fixed mouse button.
This commit is contained in:
parent
cd2d643522
commit
8dc34db44a
1 changed files with 16 additions and 1 deletions
|
@ -282,7 +282,22 @@ namespace entry
|
|||
WindowHandle handle = findHandle(mev.windowID);
|
||||
if (isValid(handle) )
|
||||
{
|
||||
m_eventQueue.postMouseEvent(handle, mev.x, mev.y, 0, MouseButton::Left, mev.type == SDL_MOUSEBUTTONDOWN);
|
||||
MouseButton::Enum button;
|
||||
switch (mev.button)
|
||||
{
|
||||
default:
|
||||
case SDL_BUTTON_LEFT: button = MouseButton::Left; break;
|
||||
case SDL_BUTTON_MIDDLE: button = MouseButton::Middle; break;
|
||||
case SDL_BUTTON_RIGHT: button = MouseButton::Right; break;
|
||||
}
|
||||
|
||||
m_eventQueue.postMouseEvent(handle
|
||||
, mev.x
|
||||
, mev.y
|
||||
, 0
|
||||
, button
|
||||
, mev.type == SDL_MOUSEBUTTONDOWN
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue