mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-04 14:09:47 +03:00
* Fix first mouse event being skipped due to reading garbage
This commit is contained in:
@@ -8,6 +8,18 @@
|
||||
|
||||
#include "MouseDevice.hpp"
|
||||
|
||||
MouseDevice::MouseDevice()
|
||||
{
|
||||
_index = -1;
|
||||
_x = 0;
|
||||
_y = 0;
|
||||
_xOld = 0;
|
||||
_yOld = 0;
|
||||
|
||||
for (int i = 0; i < BUTTON_COUNT; i++)
|
||||
_buttonStates[i] = 0;
|
||||
}
|
||||
|
||||
void MouseDevice::feed(MouseButtonType buttonType, bool buttonState, int posX, int posY)
|
||||
{
|
||||
if (buttonType != BUTTON_NONE)
|
||||
|
||||
@@ -59,6 +59,7 @@ struct MouseAction
|
||||
class MouseDevice
|
||||
{
|
||||
public:
|
||||
MouseDevice();
|
||||
void feed(MouseButtonType buttonType, bool buttonState, int posX, int posY);
|
||||
short getX();
|
||||
short getY();
|
||||
|
||||
Reference in New Issue
Block a user