From 19bd3f733bc22a781a3e83291b57f4a9ab56688d Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 7 Apr 2016 10:45:45 +0200 Subject: [PATCH] Use SDL constants for mouse buttons --- Sources/Engine/Base/SDL/SDLEvents.cpp | 4 ++-- Sources/Engine/Base/SDL/SDLInput.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/Engine/Base/SDL/SDLEvents.cpp b/Sources/Engine/Base/SDL/SDLEvents.cpp index 512cfce..6ef1800 100644 --- a/Sources/Engine/Base/SDL/SDLEvents.cpp +++ b/Sources/Engine/Base/SDL/SDLEvents.cpp @@ -59,7 +59,7 @@ BOOL PeekMessage(MSG *msg, void *hwnd, UINT wMsgFilterMin, break; case SDL_MOUSEBUTTONDOWN: - if (sdlevent.button.button == 2) // right button... + if (sdlevent.button.button == SDL_BUTTON_RIGHT) // right button... { msg->message = WM_RBUTTONDOWN; } // if @@ -78,7 +78,7 @@ BOOL PeekMessage(MSG *msg, void *hwnd, UINT wMsgFilterMin, break; case SDL_MOUSEBUTTONUP: - if (sdlevent.button.button == 2) // right button... + if (sdlevent.button.button == SDL_BUTTON_RIGHT) // right button... { msg->message = WM_RBUTTONUP; } // if diff --git a/Sources/Engine/Base/SDL/SDLInput.cpp b/Sources/Engine/Base/SDL/SDLInput.cpp index 332fa72..07f985d 100644 --- a/Sources/Engine/Base/SDL/SDLInput.cpp +++ b/Sources/Engine/Base/SDL/SDLInput.cpp @@ -328,13 +328,13 @@ static void sdl_event_handler(const SDL_Event *event) case SDL_MOUSEBUTTONDOWN: switch (event->button.button) { - case 1: + case SDL_BUTTON_LEFT: _abKeysPressed[KID_MOUSE1] = TRUE; break; - case 2: + case SDL_BUTTON_RIGHT: _abKeysPressed[KID_MOUSE2] = TRUE; break; - case 3: + case SDL_BUTTON_MIDDLE: _abKeysPressed[KID_MOUSE3] = TRUE; break; @@ -351,13 +351,13 @@ static void sdl_event_handler(const SDL_Event *event) case SDL_MOUSEBUTTONUP: switch (event->button.button) { - case 1: + case SDL_BUTTON_LEFT: _abKeysPressed[KID_MOUSE1] = FALSE; break; - case 2: + case SDL_BUTTON_RIGHT: _abKeysPressed[KID_MOUSE2] = FALSE; break; - case 3: + case SDL_BUTTON_MIDDLE: _abKeysPressed[KID_MOUSE3] = FALSE; break;