MyGUI  3.4.0
MyGUI_InputManager.cpp
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #include "MyGUI_Precompiled.h"
8 #include "MyGUI_InputManager.h"
9 #include "MyGUI_Widget.h"
10 #include "MyGUI_WidgetManager.h"
11 #include "MyGUI_Gui.h"
12 #include "MyGUI_WidgetManager.h"
13 #include "MyGUI_Constants.h"
14 
15 namespace MyGUI
16 {
17 
18  // In seconds
19  const float INPUT_TIME_DOUBLE_CLICK = 0.25f;
20  const float INPUT_DELAY_FIRST_KEY = 0.4f;
21  const float INPUT_INTERVAL_KEY = 0.05f;
22 
24  template <> const char* Singleton<InputManager>::mClassTypeName = "InputManager";
25 
27  mWidgetMouseFocus(nullptr),
28  mWidgetKeyFocus(nullptr),
29  mLayerMouseFocus(nullptr),
30  mTimerDoubleClick(INPUT_TIME_DOUBLE_CLICK),
31  mIsShiftPressed(false),
32  mIsControlPressed(false),
33  mHoldKey(KeyCode::None),
34  mHoldChar(0),
35  mFirstPressKey(false),
36  mTimerKey(0.0f),
37  mOldAbsZ(0),
38  mIsInitialise(false)
39  {
41  }
42 
44  {
45  MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
46  MYGUI_LOG(Info, "* Initialise: " << getClassTypeName());
47 
48  mWidgetMouseFocus = nullptr;
49  mWidgetKeyFocus = nullptr;
50  mLayerMouseFocus = nullptr;
51  for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i)
52  {
53  mMouseCapture[i] = false;
54  }
55  mIsShiftPressed = false;
56  mIsControlPressed = false;
57  mHoldKey = KeyCode::None;
58  mHoldChar = 0;
59  mFirstPressKey = true;
60  mTimerKey = 0.0f;
61  mOldAbsZ = 0;
62 
64  Gui::getInstance().eventFrameStart += newDelegate(this, &InputManager::frameEntered);
65 
66  MYGUI_LOG(Info, getClassTypeName() << " successfully initialized");
67  mIsInitialise = true;
68  }
69 
71  {
72  MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " is not initialised");
73  MYGUI_LOG(Info, "* Shutdown: " << getClassTypeName());
74 
75  Gui::getInstance().eventFrameStart -= newDelegate(this, &InputManager::frameEntered);
77 
78  MYGUI_LOG(Info, getClassTypeName() << " successfully shutdown");
79  mIsInitialise = false;
80  }
81 
82  bool InputManager::injectMouseMove(int _absx, int _absy, int _absz)
83  {
84  // запоминаем позицию
85  mMousePosition.set(_absx, _absy);
86 
87  // вычисляем прирост по колеса
88  int relz = _absz - mOldAbsZ;
89  mOldAbsZ = _absz;
90 
91  // проверка на скролл
92  if (relz != 0)
93  {
94  bool isFocus = isFocusMouse();
95  if (isFocusMouse())
96  mWidgetMouseFocus->_riseMouseWheel(relz);
97  return isFocus;
98  }
99 
100  if (isCaptureMouse())
101  {
102  if (isFocusMouse())
103  {
104  if (mLayerMouseFocus != nullptr)
105  {
106  IntPoint point = mLayerMouseFocus->getPosition(_absx, _absy);
107  for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i)
108  {
109  if (mMouseCapture[i])
110  mWidgetMouseFocus->_riseMouseDrag(point.left, point.top, MouseButton::Enum(i));
111  }
112  }
113  }
114  else
115  {
117  }
118 
119  return true;
120  }
121 
122  Widget* old_mouse_focus = mWidgetMouseFocus;
123 
124  // ищем активное окно
125  Widget* item = LayerManager::getInstance().getWidgetFromPoint(_absx, _absy);
126 
127  // ничего не изменилось
128  if (mWidgetMouseFocus == item)
129  {
130  bool isFocus = isFocusMouse();
131  if (isFocusMouse())
132  {
133  if (mLayerMouseFocus != nullptr)
134  {
135  IntPoint point = mLayerMouseFocus->getPosition(_absx, _absy);
136  mWidgetMouseFocus->_riseMouseMove(point.left, point.top);
137  }
138  }
139  return isFocus;
140  }
141 
142  if (item)
143  {
144  // поднимаемся до рута
145  Widget* root = item;
146  while (root->getParent()) root = root->getParent();
147 
148  // проверяем на модальность
149  if (!mVectorModalRootWidget.empty())
150  {
151  if (root != mVectorModalRootWidget.back())
152  {
153  item = nullptr;
154  }
155  }
156 
157  if (item != nullptr)
158  {
159  mLayerMouseFocus = root->getLayer();
160  }
161  }
162 
163  //-------------------------------------------------------------------------------------//
164  // новый вид рутового фокуса мыши
165  Widget* save_widget = nullptr;
166 
167  // спускаемся по новому виджету и устанавливаем рутовый фокус
168  Widget* root_focus = item;
169  while (root_focus != nullptr)
170  {
171  if (root_focus->getRootMouseFocus())
172  {
173  save_widget = root_focus;
174  break;
175  }
176 
177  root_focus->_setRootMouseFocus(true);
178  root_focus->_riseMouseChangeRootFocus(true);
179  root_focus = root_focus->getParent();
180  }
181 
182  // спускаемся по старому виджету и сбрасываем фокус
183  root_focus = mWidgetMouseFocus;
184  while (root_focus != nullptr)
185  {
186  if (root_focus == save_widget)
187  break;
188 
189  root_focus->_setRootMouseFocus(false);
190  root_focus->_riseMouseChangeRootFocus(false);
191  root_focus = root_focus->getParent();
192  }
193  //-------------------------------------------------------------------------------------//
194 
195  // смена фокуса, проверяем на доступность виджета
196  if (isFocusMouse() && mWidgetMouseFocus->getInheritedEnabled())
197  {
198  mWidgetMouseFocus->_riseMouseLostFocus(item);
199  }
200 
201  if ((item != nullptr) && (item->getInheritedEnabled()))
202  {
203  MyGUI::IntPoint point (_absx, _absy);
204  if (mLayerMouseFocus != nullptr)
205  point = mLayerMouseFocus->getPosition(_absx, _absy);
206  item->_riseMouseMove(point.left, point.top);
207  item->_riseMouseSetFocus(mWidgetMouseFocus);
208  }
209 
210  // запоминаем текущее окно
211  mWidgetMouseFocus = item;
212 
213  if (old_mouse_focus != mWidgetMouseFocus)
214  {
215  // Reset double click timer, double clicks should only work when clicking on the *same* item twice
216  mTimerDoubleClick = INPUT_TIME_DOUBLE_CLICK;
217  eventChangeMouseFocus(mWidgetMouseFocus);
218  }
219 
220  return isFocusMouse();
221  }
222 
223  bool InputManager::injectMousePress(int _absx, int _absy, MouseButton _id)
224  {
225  injectMouseMove(_absx, _absy, mOldAbsZ);
226 
227  // если мы щелкнули не на гуй
228  if (!isFocusMouse())
229  {
231 
232  return false;
233  }
234 
235  // если активный элемент заблокирован
236  //FIXME
237  if (!mWidgetMouseFocus->getInheritedEnabled())
238  return true;
239 
240  if (MouseButton::None != _id && MouseButton::MAX != _id)
241  {
242  // start capture
243  mMouseCapture[_id.getValue()] = true;
244  // remember last pressed position
245  if (mLayerMouseFocus != nullptr)
246  {
247  IntPoint point = mLayerMouseFocus->getPosition(_absx, _absy);
248  mLastPressed[_id.getValue()] = point;
249  }
250  }
251 
252  // ищем вверх тот виджет который может принимать фокус
253  Widget* item = mWidgetMouseFocus;
254  while ((item != nullptr) && (!item->getNeedKeyFocus()))
255  item = item->getParent();
256 
257  // устанавливаем перед вызовом т.к. возможно внутри ктонить поменяет фокус под себя
258  setKeyFocusWidget(item);
259 
260  if (isFocusMouse())
261  {
262  IntPoint point (_absx, _absy);
263  if (mLayerMouseFocus != nullptr)
264  point = mLayerMouseFocus->getPosition(_absx, _absy);
265  mWidgetMouseFocus->_riseMouseButtonPressed(point.left, point.top, _id);
266 
267  // после пресса может сброситься
268  if (mWidgetMouseFocus)
269  {
270  // поднимаем виджет, надо подумать что делать если поменялся фокус клавы
271  LayerManager::getInstance().upLayerItem(mWidgetMouseFocus);
272 
273  // поднимаем пикинг Overlapped окон
274  Widget* pick = mWidgetMouseFocus;
275  do
276  {
277  // если оверлаппед, то поднимаем пикинг
279  {
280  if (pick->getParent()) pick->getParent()->_forcePick(pick);
281  }
282 
283  pick = pick->getParent();
284  }
285  while (pick);
286  }
287  }
288 
289  return true;
290  }
291 
292  bool InputManager::injectMouseRelease(int _absx, int _absy, MouseButton _id)
293  {
294  if (isFocusMouse())
295  {
296  // если активный элемент заблокирован
297  if (!mWidgetMouseFocus->getInheritedEnabled())
298  return true;
299 
300  if (_id != MouseButton::None && _id != MouseButton::MAX)
301  {
302  if (mMouseCapture[_id.getValue()])
303  {
304  // drop capture
305  mMouseCapture[_id.getValue()] = false;
306  }
307  }
308 
309  IntPoint point (_absx, _absy);
310  if (mLayerMouseFocus != nullptr)
311  point = mLayerMouseFocus->getPosition(_absx, _absy);
312  mWidgetMouseFocus->_riseMouseButtonReleased(point.left, point.top, _id);
313 
314  // после вызова, виджет может быть сброшен
315  if (nullptr != mWidgetMouseFocus)
316  {
317  if (MouseButton::Left == _id)
318  {
319  if (mTimerDoubleClick < INPUT_TIME_DOUBLE_CLICK)
320  {
321  mWidgetMouseFocus->_riseMouseButtonClick();
322  // после вызова, виджет может быть сброшен
323  if (nullptr != mWidgetMouseFocus)
324  mWidgetMouseFocus->_riseMouseButtonDoubleClick();
325  }
326  else
327  {
328  // проверяем над тем ли мы окном сейчас что и были при нажатии
329  Widget* item = LayerManager::getInstance().getWidgetFromPoint(_absx, _absy);
330  if ( item == mWidgetMouseFocus)
331  {
332  mWidgetMouseFocus->_riseMouseButtonClick();
333  }
334  mTimerDoubleClick = 0;
335  }
336  }
337  }
338 
339  // для корректного отображения
340  injectMouseMove(_absx, _absy, mOldAbsZ);
341 
342  return true;
343  }
344 
345  return false;
346  }
347 
349  {
350  // проверка на переключение языков
351  firstEncoding(_key, true);
352 
353  // запоминаем клавишу
354  storeKey(_key, _text);
355 
356  bool wasFocusKey = isFocusKey();
357 
358  //Pass keystrokes to the current active text widget
359  if (isFocusKey())
360  {
361  mWidgetKeyFocus->_riseKeyButtonPressed(_key, _text);
362  }
363 
364  return wasFocusKey;
365  }
366 
368  {
369  // проверка на переключение языков
370  firstEncoding(_key, false);
371 
372  // сбрасываем клавишу
373  resetKey();
374 
375  bool wasFocusKey = isFocusKey();
376 
377  if (isFocusKey())
378  mWidgetKeyFocus->_riseKeyButtonReleased(_key);
379 
380  return wasFocusKey;
381  }
382 
383  void InputManager::firstEncoding(KeyCode _key, bool bIsKeyPressed)
384  {
385  if ((_key == KeyCode::LeftShift) || (_key == KeyCode::RightShift))
386  mIsShiftPressed = bIsKeyPressed;
387  if ((_key == KeyCode::LeftControl) || (_key == KeyCode::RightControl))
388  mIsControlPressed = bIsKeyPressed;
389  }
390 
392  {
393  if (_widget == mWidgetKeyFocus)
394  return;
395 
396  Widget* oldKeyFocus = mWidgetKeyFocus;
397  mWidgetKeyFocus = nullptr;
398 
399  Widget* sharedRootFocus = nullptr; // possible shared parent for both old and new widget
400 
401  // recursively set root key focus
402  Widget* rootFocus = _widget;
403  while (rootFocus != nullptr)
404  {
405  if (rootFocus->getRootKeyFocus())
406  {
407  sharedRootFocus = rootFocus;
408  break;
409  }
410 
411  rootFocus->_setRootKeyFocus(true);
412  rootFocus->_riseKeyChangeRootFocus(true);
413  rootFocus = rootFocus->getParent();
414  }
415 
416  // recursively reset root key focus
417  rootFocus = oldKeyFocus;
418  while (rootFocus != nullptr)
419  {
420  if (rootFocus == sharedRootFocus)
421  break;
422 
423  rootFocus->_setRootKeyFocus(false);
424  rootFocus->_riseKeyChangeRootFocus(false);
425  rootFocus = rootFocus->getParent();
426  }
427  //-------------------------------------------------------------------------------------//
428 
429  mWidgetKeyFocus = _widget;
430 
431  if (oldKeyFocus)
432  {
433  oldKeyFocus->_riseKeyLostFocus(_widget);
434  }
435 
436  if (_widget)
437  {
438  _widget->_riseKeySetFocus(mWidgetKeyFocus);
439  }
440 
441  eventChangeKeyFocus(mWidgetKeyFocus);
442  }
443 
445  {
446  Widget* mouseFocus = mWidgetMouseFocus;
447  mWidgetMouseFocus = nullptr;
448 
449  // recursively reset old widget focus
450  Widget* root_focus = mouseFocus;
451  while (root_focus != nullptr)
452  {
453  root_focus->_setRootMouseFocus(false);
454  root_focus->_riseMouseChangeRootFocus(false);
455  root_focus = root_focus->getParent();
456  }
457 
458  for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i)
459  {
460  if (mMouseCapture[i])
461  {
462  mMouseCapture[i] = false;
463  mouseFocus->_riseMouseButtonReleased(mLastPressed[i].left, mLastPressed[i].top, MouseButton::Enum(i));
464  }
465  }
466 
467  if (nullptr != mouseFocus)
468  {
469  mouseFocus->_riseMouseLostFocus(nullptr);
470  }
471 
472  if (mouseFocus != mWidgetMouseFocus)
473  eventChangeMouseFocus(mWidgetMouseFocus);
474  }
475 
476  // удаляем данный виджет из всех возможных мест
477  void InputManager::_unlinkWidget(Widget* _widget)
478  {
479  if (nullptr == _widget)
480  return;
481 
482  if (mWidgetMouseFocus == _widget)
484 
485  if (_widget == mWidgetKeyFocus)
487 
488  // ручками сбрасываем, чтобы не менять фокусы
489  for (VectorWidgetPtr::iterator iter = mVectorModalRootWidget.begin(); iter != mVectorModalRootWidget.end(); ++iter)
490  {
491  if (*iter == _widget)
492  {
493  mVectorModalRootWidget.erase(iter);
494  break;
495  }
496  }
497  }
498 
500  {
501  if (nullptr == _widget)
502  return;
503  MYGUI_ASSERT(nullptr == _widget->getParent(), "Modal widget must be root");
504 
506  removeWidgetModal(_widget);
507  mVectorModalRootWidget.push_back(_widget);
508 
509  setKeyFocusWidget(_widget);
511  }
512 
514  {
515  resetKeyFocusWidget(_widget);
517 
518  for (VectorWidgetPtr::iterator iter = mVectorModalRootWidget.begin(); iter != mVectorModalRootWidget.end(); ++iter)
519  {
520  if (*iter == _widget)
521  {
522  mVectorModalRootWidget.erase(iter);
523  break;
524  }
525  }
526  // если еще есть модальные то их фокусируем и поднимаем
527  if (!mVectorModalRootWidget.empty())
528  {
529  setKeyFocusWidget(mVectorModalRootWidget.back());
530  LayerManager::getInstance().upLayerItem(mVectorModalRootWidget.back());
531  }
532  }
533 
534  void InputManager::storeKey(KeyCode _key, Char _text)
535  {
536  mHoldKey = KeyCode::None;
537  mHoldChar = 0;
538 
539  if ( !isFocusKey() ) return;
540  if ( (_key == KeyCode::LeftShift) || (_key == KeyCode::RightShift)
541  || (_key == KeyCode::LeftControl) || (_key == KeyCode::RightControl)
542  || (_key == KeyCode::LeftAlt) || (_key == KeyCode::RightAlt)
543  ) return;
544 
545  mFirstPressKey = true;
546  mHoldKey = _key;
547  mHoldChar = _text;
548  mTimerKey = 0.0f;
549  }
550 
551  void InputManager::resetKey()
552  {
553  mHoldKey = KeyCode::None;
554  mHoldChar = 0;
555  }
556 
557  void InputManager::frameEntered(float _frame)
558  {
559  mTimerDoubleClick += _frame;
560 
561  if ( mHoldKey == KeyCode::None)
562  return;
563 
564  if ( !isFocusKey() )
565  {
566  mHoldKey = KeyCode::None;
567  mHoldChar = 0;
568  return;
569  }
570 
571  mTimerKey += _frame;
572 
573  if (mFirstPressKey)
574  {
575  if (mTimerKey > INPUT_DELAY_FIRST_KEY)
576  {
577  mFirstPressKey = false;
578  mTimerKey = 0.0f;
579  }
580  }
581  else
582  {
583  if (mTimerKey > INPUT_INTERVAL_KEY)
584  {
585  while (mTimerKey > INPUT_INTERVAL_KEY)
586  mTimerKey -= INPUT_INTERVAL_KEY;
587  mWidgetKeyFocus->_riseKeyButtonPressed(mHoldKey, mHoldChar);
588  // focus can be dropped in onKeyButtonPressed
589  if (isFocusKey())
590  mWidgetKeyFocus->_riseKeyButtonReleased(mHoldKey);
591  }
592  }
593 
594  }
595 
597  {
598  if (mWidgetKeyFocus == _widget)
599  setKeyFocusWidget(nullptr);
600  }
601 
603  {
604  if (mLayerMouseFocus != nullptr)
605  return mLayerMouseFocus->getPosition(mMousePosition.left, mMousePosition.top);
606  return mMousePosition;
607  }
608 
610  {
611  return mWidgetMouseFocus != nullptr;
612  }
613 
615  {
616  return mWidgetKeyFocus != nullptr;
617  }
618 
620  {
621  for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i)
622  {
623  if (mMouseCapture[i])
624  return true;
625  }
626  return false;
627  }
628 
630  {
631  setKeyFocusWidget(nullptr);
632  }
633 
635  {
636  return mWidgetMouseFocus;
637  }
638 
640  {
641  return mWidgetKeyFocus;
642  }
643 
645  {
646  if (_id != MouseButton::None && _id != MouseButton::MAX)
647  {
648  return mLastPressed[_id.getValue()];
649  }
651  }
652 
654  {
655  return mMousePosition;
656  }
657 
659  {
660  return !mVectorModalRootWidget.empty();
661  }
662 
664  {
665  return mIsControlPressed;
666  }
667 
669  {
670  return mIsShiftPressed;
671  }
672 
674  {
675  for (int i = MouseButton::Button0; i < MouseButton::MAX; ++i)
676  {
677  mMouseCapture[i] = false;
678  }
679  }
680 
682  {
683  _unlinkWidget(_widget);
684  }
685 
686 } // namespace MyGUI
MyGUI::MouseButton::None
@ None
Definition: MyGUI_MouseButton.h:19
MyGUI::Char
unsigned int Char
Definition: MyGUI_Types.h:48
MyGUI::Singleton< WidgetManager >::getInstance
static WidgetManager & getInstance()
Definition: MyGUI_Singleton.h:44
MyGUI::Widget::getParent
Widget * getParent() const
Definition: MyGUI_Widget.cpp:1274
MyGUI::Gui::eventFrameStart
EventHandle_FrameEventDelegate eventFrameStart
Definition: MyGUI_Gui.h:150
MyGUI::InputManager::_resetMouseFocusWidget
void _resetMouseFocusWidget()
Definition: MyGUI_InputManager.cpp:444
MyGUI::InputManager::resetMouseCaptureWidget
void resetMouseCaptureWidget()
Definition: MyGUI_InputManager.cpp:673
MyGUI_Gui.h
MyGUI::Widget::getInheritedEnabled
bool getInheritedEnabled() const
Definition: MyGUI_Widget.cpp:1334
MyGUI::InputManager::getKeyFocusWidget
Widget * getKeyFocusWidget() const
Definition: MyGUI_InputManager.cpp:639
MyGUI::InputManager::setKeyFocusWidget
void setKeyFocusWidget(Widget *_widget)
Definition: MyGUI_InputManager.cpp:391
MyGUI_Constants.h
MyGUI::LayerItem::getLayer
ILayer * getLayer() const
Definition: MyGUI_LayerItem.cpp:206
MyGUI::InputManager::isShiftPressed
bool isShiftPressed() const
Definition: MyGUI_InputManager.cpp:668
MyGUI::InputManager
Definition: MyGUI_InputManager.h:31
MyGUI_Widget.h
MyGUI::types::TPoint::top
T top
Definition: MyGUI_TPoint.h:21
MyGUI::WidgetInput::_riseKeyChangeRootFocus
void _riseKeyChangeRootFocus(bool _focus)
Definition: MyGUI_WidgetInput.cpp:126
MyGUI::WidgetInput::_riseMouseSetFocus
void _riseMouseSetFocus(Widget *_old)
Definition: MyGUI_WidgetInput.cpp:48
MyGUI::InputManager::eventChangeKeyFocus
delegates::CMultiDelegate1< Widget * > eventChangeKeyFocus
Definition: MyGUI_InputManager.h:125
MyGUI::InputManager::shutdown
void shutdown()
Definition: MyGUI_InputManager.cpp:70
MyGUI::WidgetInput::_riseMouseDrag
void _riseMouseDrag(int _left, int _top, MouseButton _id)
Definition: MyGUI_WidgetInput.cpp:54
MyGUI::InputManager::getMouseFocusWidget
Widget * getMouseFocusWidget() const
Definition: MyGUI_InputManager.cpp:634
MyGUI::WidgetInput::getRootKeyFocus
bool getRootKeyFocus() const
Definition: MyGUI_WidgetInput.cpp:187
MyGUI::WidgetManager::registerUnlinker
void registerUnlinker(IUnlinkWidget *_unlink)
Definition: MyGUI_WidgetManager.cpp:133
MyGUI::Singleton< InputManager >::getClassTypeName
static const char * getClassTypeName()
Definition: MyGUI_Singleton.h:55
MyGUI::MouseButton::getValue
int getValue() const
Definition: MyGUI_MouseButton.h:51
MyGUI::Widget
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:37
MyGUI::Widget::getWidgetStyle
WidgetStyle getWidgetStyle() const
Definition: MyGUI_Widget.cpp:1299
MyGUI::types::TPoint< int >
MyGUI::InputManager::injectMouseMove
bool injectMouseMove(int _absx, int _absy, int _absz)
Definition: MyGUI_InputManager.cpp:82
MyGUI::InputManager::resetKeyFocusWidget
void resetKeyFocusWidget()
Definition: MyGUI_InputManager.cpp:629
MyGUI::InputManager::isFocusMouse
bool isFocusMouse() const
Definition: MyGUI_InputManager.cpp:609
MyGUI::InputManager::unlinkWidget
void unlinkWidget(Widget *_widget)
Definition: MyGUI_InputManager.cpp:681
MyGUI::LayerManager::upLayerItem
void upLayerItem(Widget *_item)
Definition: MyGUI_LayerManager.cpp:153
MyGUI::KeyCode::RightShift
@ RightShift
Definition: MyGUI_KeyCode.h:73
MyGUI::Constants::getZeroIntPoint
static const IntPoint & getZeroIntPoint()
Definition: MyGUI_Constants.h:32
MyGUI::WidgetInput::_riseKeyButtonReleased
void _riseKeyButtonReleased(KeyCode _key)
Definition: MyGUI_WidgetInput.cpp:114
MyGUI::LayerManager::getWidgetFromPoint
Widget * getWidgetFromPoint(int _left, int _top)
Definition: MyGUI_LayerManager.cpp:212
MyGUI::KeyCode::LeftShift
@ LeftShift
Definition: MyGUI_KeyCode.h:61
MyGUI::InputManager::injectMouseRelease
bool injectMouseRelease(int _absx, int _absy, MouseButton _id)
Definition: MyGUI_InputManager.cpp:292
MyGUI::WidgetInput::_riseMouseButtonDoubleClick
void _riseMouseButtonDoubleClick()
Definition: MyGUI_WidgetInput.cpp:90
MyGUI::KeyCode::RightAlt
@ RightAlt
Definition: MyGUI_KeyCode.h:137
MyGUI::newDelegate
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
Definition: MyGUI_Delegate.h:99
MyGUI_Precompiled.h
MyGUI::Widget::_forcePick
void _forcePick(Widget *_widget)
Definition: MyGUI_Widget.cpp:513
MyGUI::InputManager::getMousePosition
const IntPoint & getMousePosition() const
Definition: MyGUI_InputManager.cpp:653
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:16
MyGUI::InputManager::injectMousePress
bool injectMousePress(int _absx, int _absy, MouseButton _id)
Definition: MyGUI_InputManager.cpp:223
MyGUI::WidgetInput::_riseMouseMove
void _riseMouseMove(int _left, int _top)
Definition: MyGUI_WidgetInput.cpp:60
MyGUI::WidgetInput::_riseMouseButtonPressed
void _riseMouseButtonPressed(int _left, int _top, MouseButton _id)
Definition: MyGUI_WidgetInput.cpp:72
MyGUI::InputManager::injectKeyPress
bool injectKeyPress(KeyCode _key, Char _text=0)
Definition: MyGUI_InputManager.cpp:348
MyGUI::InputManager::isFocusKey
bool isFocusKey() const
Definition: MyGUI_InputManager.cpp:614
MyGUI::WidgetInput::_riseMouseWheel
void _riseMouseWheel(int _rel)
Definition: MyGUI_WidgetInput.cpp:66
MyGUI::WidgetInput::_riseMouseLostFocus
void _riseMouseLostFocus(Widget *_new)
Definition: MyGUI_WidgetInput.cpp:42
MyGUI::WidgetManager::unregisterUnlinker
void unregisterUnlinker(IUnlinkWidget *_unlink)
Definition: MyGUI_WidgetManager.cpp:139
MyGUI_InputManager.h
MyGUI::types::TPoint::left
T left
Definition: MyGUI_TPoint.h:20
MyGUI::InputManager::getMousePositionByLayer
IntPoint getMousePositionByLayer()
Definition: MyGUI_InputManager.cpp:602
MyGUI::KeyCode::RightControl
@ RightControl
Definition: MyGUI_KeyCode.h:126
MyGUI::types::TPoint::set
void set(T const &_left, T const &_top)
Definition: MyGUI_TPoint.h:95
MyGUI::InputManager::eventChangeMouseFocus
delegates::CMultiDelegate1< Widget * > eventChangeMouseFocus
Definition: MyGUI_InputManager.h:119
MyGUI::InputManager::removeWidgetModal
void removeWidgetModal(Widget *_widget)
Definition: MyGUI_InputManager.cpp:513
MyGUI::MouseButton::Enum
Enum
Definition: MyGUI_MouseButton.h:18
MyGUI::InputManager::isControlPressed
bool isControlPressed() const
Definition: MyGUI_InputManager.cpp:663
MyGUI::InputManager::initialise
void initialise()
Definition: MyGUI_InputManager.cpp:43
MyGUI::WidgetStyle::Overlapped
@ Overlapped
Definition: MyGUI_WidgetStyle.h:24
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition: MyGUI_Diagnostic.h:34
MyGUI_WidgetManager.h
MyGUI::WidgetInput::_setRootKeyFocus
void _setRootKeyFocus(bool _value)
Definition: MyGUI_WidgetInput.cpp:197
MyGUI::WidgetInput::_riseMouseButtonClick
void _riseMouseButtonClick()
Definition: MyGUI_WidgetInput.cpp:84
MyGUI::WidgetInput::_riseKeyButtonPressed
void _riseKeyButtonPressed(KeyCode _key, Char _char)
Definition: MyGUI_WidgetInput.cpp:108
MyGUI::WidgetInput::_riseMouseButtonReleased
void _riseMouseButtonReleased(int _left, int _top, MouseButton _id)
Definition: MyGUI_WidgetInput.cpp:78
MyGUI::INPUT_INTERVAL_KEY
const float INPUT_INTERVAL_KEY
Definition: MyGUI_InputManager.cpp:21
MyGUI::INPUT_DELAY_FIRST_KEY
const float INPUT_DELAY_FIRST_KEY
Definition: MyGUI_InputManager.cpp:20
MyGUI::KeyCode::LeftAlt
@ LeftAlt
Definition: MyGUI_KeyCode.h:75
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition: MyGUI_Diagnostic.h:22
MyGUI::ILayer::getPosition
virtual IntPoint getPosition(int _left, int _top) const =0
MyGUI::InputManager::injectKeyRelease
bool injectKeyRelease(KeyCode _key)
Definition: MyGUI_InputManager.cpp:367
MyGUI::MouseButton::Button0
@ Button0
Definition: MyGUI_MouseButton.h:25
MyGUI::InputManager::getLastPressedPosition
const IntPoint & getLastPressedPosition(MouseButton _id) const
Definition: MyGUI_InputManager.cpp:644
MyGUI::WidgetInput::_riseKeyLostFocus
void _riseKeyLostFocus(Widget *_new)
Definition: MyGUI_WidgetInput.cpp:96
MyGUI::INPUT_TIME_DOUBLE_CLICK
const float INPUT_TIME_DOUBLE_CLICK
Definition: MyGUI_InputManager.cpp:19
MyGUI::WidgetInput::_riseMouseChangeRootFocus
void _riseMouseChangeRootFocus(bool _focus)
Definition: MyGUI_WidgetInput.cpp:120
MyGUI::MouseButton::Left
@ Left
Definition: MyGUI_MouseButton.h:21
MyGUI::InputManager::isCaptureMouse
bool isCaptureMouse() const
Definition: MyGUI_InputManager.cpp:619
MyGUI::InputManager::isModalAny
bool isModalAny() const
Definition: MyGUI_InputManager.cpp:658
MyGUI::WidgetInput::_setRootMouseFocus
void _setRootMouseFocus(bool _value)
Definition: MyGUI_WidgetInput.cpp:192
MyGUI::InputManager::InputManager
InputManager()
Definition: MyGUI_InputManager.cpp:26
MyGUI::Singleton
Definition: MyGUI_Singleton.h:22
MyGUI::WidgetInput::getRootMouseFocus
bool getRootMouseFocus() const
Definition: MyGUI_WidgetInput.cpp:182
MyGUI::InputManager::addWidgetModal
void addWidgetModal(Widget *_widget)
Definition: MyGUI_InputManager.cpp:499
MyGUI
Definition: MyGUI_ActionController.h:15
MyGUI::WidgetInput::getNeedKeyFocus
bool getNeedKeyFocus() const
Definition: MyGUI_WidgetInput.cpp:157
MyGUI::KeyCode::None
@ None
Definition: MyGUI_KeyCode.h:19
MyGUI::MouseButton::MAX
@ MAX
Definition: MyGUI_MouseButton.h:33
MyGUI::WidgetInput::_riseKeySetFocus
void _riseKeySetFocus(Widget *_old)
Definition: MyGUI_WidgetInput.cpp:102
MyGUI::KeyCode
Definition: MyGUI_KeyCode.h:16
MyGUI::KeyCode::LeftControl
@ LeftControl
Definition: MyGUI_KeyCode.h:48