mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-14 07:43:14 +00:00
Updated raw input events to match SDL style
Also added raw keyboard events, and implemented raw input events on iOS, OpenBSD console, Linux console, and X11
This commit is contained in:
@@ -103,10 +103,10 @@ static void loop(void)
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case SDL_EVENT_MOUSE_RAW_MOTION:
|
||||
case SDL_EVENT_RAW_MOUSE_MOTION:
|
||||
{
|
||||
rect.x += event.maxis.dx / event.maxis.ux;
|
||||
rect.y += event.maxis.dy / event.maxis.uy;
|
||||
rect.x += event.raw_motion.dx * event.raw_motion.scale_x;
|
||||
rect.y += event.raw_motion.dy * event.raw_motion.scale_y;
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
@@ -212,9 +212,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (raw) {
|
||||
SDL_SetEventEnabled(SDL_EVENT_MOUSE_RAW_MOTION, true);
|
||||
}
|
||||
SDL_SetEventEnabled(SDL_EVENT_RAW_MOUSE_MOTION, raw);
|
||||
|
||||
rect.x = DEFAULT_WINDOW_WIDTH / 2;
|
||||
rect.y = DEFAULT_WINDOW_HEIGHT / 2;
|
||||
|
||||
Reference in New Issue
Block a user