mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 00:18:28 +00:00
Rename mouse BUTTON(DOWN|UP) event to BUTTON_(DOWN|UP)
This commit is contained in:

committed by
Sam Lantinga

parent
413376cdb3
commit
758c0dd6d8
@@ -296,10 +296,10 @@ static void SDL_LogEvent(const SDL_Event *event)
|
||||
(uint)event->button.which, (uint)event->button.button, \
|
||||
event->button.state == SDL_PRESSED ? "pressed" : "released", \
|
||||
(uint)event->button.clicks, event->button.x, event->button.y)
|
||||
SDL_EVENT_CASE(SDL_EVENT_MOUSE_BUTTONDOWN)
|
||||
SDL_EVENT_CASE(SDL_EVENT_MOUSE_BUTTON_DOWN)
|
||||
PRINT_MBUTTON_EVENT(event);
|
||||
break;
|
||||
SDL_EVENT_CASE(SDL_EVENT_MOUSE_BUTTONUP)
|
||||
SDL_EVENT_CASE(SDL_EVENT_MOUSE_BUTTON_UP)
|
||||
PRINT_MBUTTON_EVENT(event);
|
||||
break;
|
||||
#undef PRINT_MBUTTON_EVENT
|
||||
|
@@ -687,11 +687,11 @@ static int SDL_PrivateSendMouseButton(Uint64 timestamp, SDL_Window *window, SDL_
|
||||
/* Figure out which event to perform */
|
||||
switch (state) {
|
||||
case SDL_PRESSED:
|
||||
type = SDL_EVENT_MOUSE_BUTTONDOWN;
|
||||
type = SDL_EVENT_MOUSE_BUTTON_DOWN;
|
||||
buttonstate |= SDL_BUTTON(button);
|
||||
break;
|
||||
case SDL_RELEASED:
|
||||
type = SDL_EVENT_MOUSE_BUTTONUP;
|
||||
type = SDL_EVENT_MOUSE_BUTTON_UP;
|
||||
buttonstate &= ~SDL_BUTTON(button);
|
||||
break;
|
||||
default:
|
||||
|
@@ -772,8 +772,8 @@ static int SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (event->type == SDL_EVENT_MOUSE_BUTTONDOWN ||
|
||||
event->type == SDL_EVENT_MOUSE_BUTTONUP) {
|
||||
} else if (event->type == SDL_EVENT_MOUSE_BUTTON_DOWN ||
|
||||
event->type == SDL_EVENT_MOUSE_BUTTON_UP) {
|
||||
SDL_Window *window = SDL_GetWindowFromID(event->button.windowID);
|
||||
if (window == renderer->window) {
|
||||
int logical_w, logical_h;
|
||||
|
@@ -1526,12 +1526,12 @@ static void SDLTest_PrintEvent(SDL_Event *event)
|
||||
event->motion.xrel, event->motion.yrel,
|
||||
event->motion.windowID);
|
||||
break;
|
||||
case SDL_EVENT_MOUSE_BUTTONDOWN:
|
||||
case SDL_EVENT_MOUSE_BUTTON_DOWN:
|
||||
SDL_Log("SDL EVENT: Mouse: button %d pressed at %g,%g with click count %d in window %" SDL_PRIu32,
|
||||
event->button.button, event->button.x, event->button.y, event->button.clicks,
|
||||
event->button.windowID);
|
||||
break;
|
||||
case SDL_EVENT_MOUSE_BUTTONUP:
|
||||
case SDL_EVENT_MOUSE_BUTTON_UP:
|
||||
SDL_Log("SDL EVENT: Mouse: button %d released at %g,%g with click count %d in window %" SDL_PRIu32,
|
||||
event->button.button, event->button.x, event->button.y, event->button.clicks,
|
||||
event->button.windowID);
|
||||
|
@@ -658,10 +658,10 @@ static EM_BOOL Emscripten_HandleMouseButton(int eventType, const EmscriptenMouse
|
||||
emscripten_request_pointerlock(window_data->canvas_id, 0); /* try to regrab lost pointer lock. */
|
||||
}
|
||||
sdl_button_state = SDL_PRESSED;
|
||||
sdl_event_type = SDL_EVENT_MOUSE_BUTTONDOWN;
|
||||
sdl_event_type = SDL_EVENT_MOUSE_BUTTON_DOWN;
|
||||
} else {
|
||||
sdl_button_state = SDL_RELEASED;
|
||||
sdl_event_type = SDL_EVENT_MOUSE_BUTTONUP;
|
||||
sdl_event_type = SDL_EVENT_MOUSE_BUTTON_UP;
|
||||
}
|
||||
SDL_SendMouseButton(0, window_data->window, 0, sdl_button_state, sdl_button);
|
||||
|
||||
|
Reference in New Issue
Block a user