Browse Source

Capitalization & other minor code style edits to the SDL raw event sending. Sync contributor credits.

Lasse Öörni 9 years ago
parent
commit
a44c0a7a43
4 changed files with 16 additions and 11 deletions
  1. 1 1
      Docs/Urho3D.dox
  2. 1 1
      README.md
  3. 12 7
      Source/Urho3D/Input/Input.cpp
  4. 2 2
      Source/Urho3D/Input/InputEvents.h

+ 1 - 1
Docs/Urho3D.dox

@@ -85,6 +85,7 @@ Urho3D development, contributions and bugfixes by:
 - Gunnar Kriik
 - Aliaksandr Kryvashein
 - Artem Kulyk
+- Rokas Kupstys
 - Ali Kämäräinen
 - Pete Leigh
 - Frode 'Modanung' Lindeijer
@@ -147,7 +148,6 @@ Urho3D development, contributions and bugfixes by:
 - reattiva
 - rifai
 - rikorin
-- r-ku
 - skaiware
 - ssinai1
 - svifylabs

+ 1 - 1
README.md

@@ -37,6 +37,7 @@ Urho3D development, contributions and bugfixes by:
 - Gunnar Kriik
 - Aliaksandr Kryvashein
 - Artem Kulyk
+- Rokas Kupstys
 - Ali Kämäräinen
 - Pete Leigh
 - Frode 'Modanung' Lindeijer
@@ -62,7 +63,6 @@ Urho3D development, contributions and bugfixes by:
 - Yusuf Umar
 - Daniel Wiberg
 - Steven Zhang
-- Rokas Kupstys
 - AGreatFish
 - BlueMagnificent
 - Enhex

+ 12 - 7
Source/Urho3D/Input/Input.cpp

@@ -1837,13 +1837,18 @@ void Input::HandleSDLEvent(void* sdlEvent)
             return;
     }
 
-    VariantMap eventData;
-    eventData[SdlRawInput::P_SDL_EVENT] = &evt;
-    eventData[SdlRawInput::P_CONSUMED] = false;
-    SendEvent(E_SDLRAWINPUT, eventData);
-
-    if (eventData[SdlRawInput::P_CONSUMED].GetBool())
-        return;
+    // Possibility for custom handling or suppression of default handling for the SDL event
+    {
+        using namespace SDLRawInput;
+    
+        VariantMap eventData = GetEventDataMap();
+        eventData[P_SDLEVENT] = &evt;
+        eventData[P_CONSUMED] = false;
+        SendEvent(E_SDLRAWINPUT, eventData);
+
+        if (eventData[P_CONSUMED].GetBool())
+            return;
+    }
 
     switch (evt.type)
     {

+ 2 - 2
Source/Urho3D/Input/InputEvents.h

@@ -222,9 +222,9 @@ URHO3D_EVENT(E_EXITREQUESTED, ExitRequested)
 }
 
 /// Raw SDL input event.
-URHO3D_EVENT(E_SDLRAWINPUT, SdlRawInput)
+URHO3D_EVENT(E_SDLRAWINPUT, SDLRawInput)
 {
-    URHO3D_PARAM(P_SDL_EVENT, SdlEvent);           // SDL_Event*
+    URHO3D_PARAM(P_SDLEVENT, SDLEvent);           // SDL_Event*
     URHO3D_PARAM(P_CONSUMED, Consumed);            // bool
 }