7#ifndef MYGUI_INPUT_MANAGER_H_
8#define MYGUI_INPUT_MANAGER_H_
39 bool injectMouseMove(
int _absx,
int _absy,
int _absz);
43 bool injectMousePress(
int _absx,
int _absy, MouseButton _id);
47 bool injectMouseRelease(
int _absx,
int _absy, MouseButton _id);
52 void setDoubleClickTime(
float _value);
54 float getDoubleClickTime()
const;
59 bool injectKeyPress(KeyCode _key, Char _text = 0);
63 bool injectKeyRelease(KeyCode _key);
66 bool isFocusMouse()
const;
68 bool isFocusKey()
const;
70 bool isCaptureMouse()
const;
73 void setKeyFocusWidget(Widget* _widget);
75 void resetKeyFocusWidget(Widget* _widget);
77 void resetKeyFocusWidget();
80 Widget* getMouseFocusWidget()
const;
82 Widget* getKeyFocusWidget()
const;
87 const IntPoint& getLastPressedPosition(MouseButton _id)
const;
89 IntPoint getLastPressedPositionForWidget(MouseButton _id,
const Widget* _widget)
const;
92 const IntPoint& getMousePosition()
const;
97 IntPoint getMousePositionByLayer()
const;
99 IntPoint getMousePositionForWidget(
const Widget* _widget)
const;
102 void addWidgetModal(Widget* _widget);
104 void removeWidgetModal(Widget* _widget);
107 bool isModalAny()
const;
110 bool isControlPressed()
const;
112 bool isShiftPressed()
const;
114 bool isAltPressed()
const;
116 bool isMetaPressed()
const;
122 void resetMouseCaptureWidget();
125 void unlinkWidget(Widget* _widget);
131 delegates::MultiDelegate<Widget*> eventChangeMouseFocus;
137 delegates::MultiDelegate<Widget*> eventChangeKeyFocus;
140 void _resetMouseFocusWidget();
144 void _unlinkWidget(Widget* _widget)
override;
146 void frameEntered(
float _frame);
148 void firstEncoding(KeyCode _key,
bool bIsKeyPressed);
151 void storeKey(KeyCode _key, Char _text);
157 Widget* mWidgetMouseFocus{
nullptr};
158 Widget* mWidgetKeyFocus{
nullptr};
159 ILayer* mLayerMouseFocus{
nullptr};
162 float mDoubleClickTime{0.25f};
163 float mTimerDoubleClick;
165 bool mIsShiftPressed{
false};
166 bool mIsControlPressed{
false};
167 bool mIsAltPressed{
false};
168 bool mIsMetaPressed{
false};
173 IntPoint mLastPressed[MouseButton::MAX];
176 bool mMouseCapture[MouseButton::MAX];
179 KeyCode mHoldKey{KeyCode::None};
181 bool mFirstPressKey{
false};
182 float mTimerKey{0.0f};
188 bool mIsInitialise{
false};
#define MYGUI_SINGLETON_DECLARATION(ClassName)
types::TPoint< int > IntPoint
std::vector< Widget * > VectorWidgetPtr