mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 09:57:40 +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:
parent
1025087c2e
commit
c44fa5bb07
25 changed files with 515 additions and 312 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue