update for em_mode

This commit is contained in:
sonil 2022-10-17 00:36:36 +08:00
parent 339fc41327
commit 1d68454512
2 changed files with 9 additions and 3 deletions

View File

@ -152,6 +152,8 @@ static bool clicked = false;
bool mouseDeviceGetData(MouseData* mouseState)
{
mouseState->em_mode = false;
if (gLastInputType == INPUT_TYPE_TOUCH) {
mouseState->x = gTouchMouseDeltaX;
mouseState->y = gTouchMouseDeltaY;
@ -162,7 +164,7 @@ bool mouseDeviceGetData(MouseData* mouseState)
gTouchMouseDeltaX = 0;
gTouchMouseDeltaY = 0;
if (lastType == SDL_FINGERDOWN && SDL_GetTicks() - gTouchGestureLastTouchUpTimestamp > 250) {
if (lastType == SDL_FINGERDOWN && SDL_GetTicks() - gTouchGestureLastTouchUpTimestamp > 250 && gTouchMouseLastX > screenGetWidth() / 4) {
longPressed = true;
}
@ -172,8 +174,9 @@ bool mouseDeviceGetData(MouseData* mouseState)
} else if (clicked) {
clicked = false;
if (em_mode) {
mouseState->x = gTouchMouseDeltaX;
mouseState->y = gTouchMouseDeltaY;
mouseState->em_mode = em_mode;
mouseState->rawx = gTouchMouseLastX;
mouseState->rawy = gTouchMouseLastY;
}
if (gTouchMouseLastX < screenGetWidth() / 4) {

View File

@ -11,6 +11,9 @@ typedef struct MouseData {
unsigned char buttons[2];
int wheelX;
int wheelY;
int rawx;
int rawy;
bool em_mode;
} MouseData;
typedef struct KeyboardData {