Sirikata
libogre/include/sirikata/ogre/input/InputEventCompletion.hpp
Go to the documentation of this file.
00001 // Copyright (c) 2012 Sirikata Authors. All rights reserved.
00002 // Use of this source code is governed by a BSD-style license that can
00003 // be found in the LICENSE file.
00004 
00005 #ifndef _SIRIKATA_OGRE_INPUT_EVENT_COMPLETION_HPP_
00006 #define _SIRIKATA_OGRE_INPUT_EVENT_COMPLETION_HPP_
00007 
00008 #include <sirikata/ogre/input/InputListener.hpp>
00009 #include <sirikata/ogre/input/InputEvents.hpp>
00010 
00011 namespace Sirikata {
00012 namespace Input {
00013 
00020 class SIRIKATA_OGRE_EXPORT InputEventCompletion {
00021 public:
00022     InputEventCompletion();
00023 
00024     void onKeyPressedEvent(ButtonPressedPtr ev);
00025     void onKeyRepeatedEvent(ButtonRepeatedPtr ev);
00026     void onKeyReleasedEvent(ButtonReleasedPtr ev);
00027     void onMousePressedEvent(MousePressedEventPtr ev);
00028     void onMouseDragEvent(MouseDragEventPtr ev);
00029     void onMouseReleasedEvent(MouseReleasedEventPtr ev);
00030 
00036     void updateTarget(InputListener* target);
00037 
00038 private:
00039     // The target currently receiving events
00040     InputListener* mTarget;
00041     // Tracking of outstanding events. We only need to store "down" events, but
00042     // we have to track multiple since we could have multiple keys or mouse
00043     // buttons depressed.
00044     std::map<KeyButton, ButtonEventPtr> mKeyEvents;
00045     std::map<MouseButton, MouseDownEventPtr> mMouseEvents;
00046 }; //class InputEventCompletion
00047 
00048 } // namespace Input
00049 } // namespace Sirikata
00050 
00051 #endif //_SIRIKATA_OGRE_INPUT_EVENT_COMPLETION_HPP_