00001 #ifndef SFML_INPUT_IMPL_HPP
00002 #define SFML_INPUT_IMPL_HPP
00003
00004 #include <utils.hpp>
00005 #include <input.hpp>
00006
00007 namespace sf {
00008 class Window;
00009 class Event;
00010 }
00011
00012 namespace input
00013 {
00014 class sfml_handler : public handler_impl
00015 {
00016 public :
00017
00019
00021 explicit sfml_handler(const sf::Window& pWindow, bool bMouseGrab = false);
00022
00023 void toggle_mouse_grab() override;
00024 std::string get_key_name(key::code mKey) const override;
00025
00026 void update() override;
00027 void on_sfml_event(const sf::Event& mEvent);
00028
00029 private :
00030
00031 int to_sfml_(key::code mKey) const;
00032
00033 static const int lKeyToSFML[100][2];
00034
00035 const sf::Window& mWindow_;
00036
00037 bool bMouseGrab_;
00038 bool bFirst_;
00039
00040 float fOldMouseX_, fOldMouseY_;
00041 float fWheelCache_;
00042 };
00043 }
00044
00045 #endif