Sleeping Wombat GUI  0.100
swGUI
WPFInputProxy.h
Go to the documentation of this file.
1 #pragma once
2 
10 
14 
15 
16 namespace sw {
17 namespace input
18 {
19 
28 class WPFInputProxy : public IInput
29 {
30 private:
31 
32  std::vector< const KeyboardState* > m_keyboardsStates;
33  std::vector< const MouseState* > m_mousesStates;
34  std::vector< const JoystickState* > m_joysticksStates;
35 
36  std::vector< KeyboardDeviceOPtr > m_keyboards;
37  std::vector< MouseDeviceOPtr > m_mouses;
38  std::vector< JoystickDeviceOPtr > m_joysticks;
39 
42 
44 
45 public:
46  WPFInputProxy();
48 
49  virtual bool Init ( const InputInitInfo& initInfo ) override;
50 
51  virtual const std::vector< const KeyboardState* >& GetKeyboardStates () const override;
52  virtual const std::vector< const MouseState* >& GetMouseStates () const override;
53  virtual const std::vector< const JoystickState* >& GetJoystickStates () const override;
54 
55  virtual std::vector< KeyboardDeviceOPtr >& GetKeyboardDevice () override;
56  virtual std::vector< MouseDeviceOPtr >& GetMouseDevice () override;
57  virtual std::vector< JoystickDeviceOPtr >& GetJoystickDevice () override;
58 
59  virtual std::vector< const InputDeviceInfo* > GetDevicesInfo () const override;
60 
61  virtual void Update ( float timeInterval ) override;
62  virtual bool UpdateDevices () override;
63 
64 public:
67  void KeyboardChange ( int keyId, bool pressed );
68  void MouseButtonChange ( int button, bool pressed );
69  void MousePositionChange ( double X, double Y );
70  void MouseWheelChange ( double delta );
71 
72  void LostFocus ();
73  void PostUpdate ();
75 };
76 
77 
78 
79 } // input
80 } // sw
81 
uint16_t uint16
Definition: TypesDefinitions.h:29
WPFInputProxy()
Definition: WPFInputProxy.cpp:20
virtual std::vector< JoystickDeviceOPtr > & GetJoystickDevice() override
Definition: WPFInputProxy.cpp:76
uint16 Timestamp
Definition: InputDeviceEvent.h:19
virtual std::vector< const InputDeviceInfo * > GetDevicesInfo() const override
Definition: WPFInputProxy.cpp:83
void KeyboardChange(int keyId, bool pressed)
Ustawia nowy stan przycisku na klawiaturze.
Definition: WPFInputProxy.cpp:337
virtual const std::vector< const JoystickState * > & GetJoystickStates() const override
Definition: WPFInputProxy.cpp:58
virtual const std::vector< const KeyboardState * > & GetKeyboardStates() const override
Definition: WPFInputProxy.cpp:46
Definition: DirectInputModule.cpp:11
virtual bool Init(const InputInitInfo &initInfo) override
Inicjalizuje cały moduł. Po wywołaniu tej funkcji moduł musi być gotowy do użytku w innym przypadku p...
Definition: WPFInputProxy.cpp:31
void MousePositionChange(double X, double Y)
Ustawia nową pozycję myszy.
Definition: WPFInputProxy.cpp:377
virtual void Update(float timeInterval) override
Definition: WPFInputProxy.cpp:101
virtual std::vector< KeyboardDeviceOPtr > & GetKeyboardDevice() override
Definition: WPFInputProxy.cpp:64
std::vector< const KeyboardState * > m_keyboardsStates
Copy of device state in m_keyboards.
Definition: WPFInputProxy.h:32
void MouseWheelChange(double delta)
Ustawia przesunięcie kółka myszy.
Definition: WPFInputProxy.cpp:409
virtual bool UpdateDevices() override
Funkcja na nowo sprawdza obecne w systemie urządzenia i aktualizuje wszystkie potrzebne dane...
Definition: WPFInputProxy.cpp:118
Timestamp m_eventNum
Number of event in current frame.
Definition: WPFInputProxy.h:43
virtual std::vector< MouseDeviceOPtr > & GetMouseDevice() override
Definition: WPFInputProxy.cpp:70
std::vector< const MouseState * > m_mousesStates
Copy of device state in m_mouses.
Definition: WPFInputProxy.h:33
std::vector< KeyboardDeviceOPtr > m_keyboards
Only first element is in use now.
Definition: WPFInputProxy.h:36
Initialization structure for input objects.
Definition: IInput.h:45
std::vector< const JoystickState * > m_joysticksStates
Copy of device state in m_joysticks.
Definition: WPFInputProxy.h:34
~WPFInputProxy()
Definition: WPFInputProxy.cpp:27
std::vector< JoystickDeviceOPtr > m_joysticks
Only first element is in use now.
Definition: WPFInputProxy.h:38
Klasa do przekierowywania do silnika wejścia pobranego z WPFa.
Definition: WPFInputProxy.h:28
std::vector< MouseDeviceOPtr > m_mouses
Only first element is in use now.
Definition: WPFInputProxy.h:37
void LostFocus()
Ponieważ okno straciło focus to czyścimy stan przycisków i myszy.
Definition: WPFInputProxy.cpp:424
uint16 m_lastY
Definition: WPFInputProxy.h:41
void PostUpdate()
Funkcja powinna zostać wywołana po zakończeniu przetwarzania inputu przez aplikację.
Definition: WPFInputProxy.cpp:430
virtual const std::vector< const MouseState * > & GetMouseStates() const override
Definition: WPFInputProxy.cpp:52
Interface for input classes for capturing user input.
Definition: IInput.h:65
uint16 m_lastX
Definition: WPFInputProxy.h:40
void MouseButtonChange(int button, bool pressed)
Ustawia nowy stan przycisku myszy.
Definition: WPFInputProxy.cpp:360