MyGUI 3.2.2

Public Member Functions | Data Fields
MyGUI::InputManager Class Reference

`#include <MyGUI_InputManager.h>`

Inheritance diagram for MyGUI::InputManager:
[legend]

## Public Member Functions
| InputManager ()
void | initialise ()
void | shutdown ()
bool | injectMouseMove (int _absx, int _absy, int _absz)
bool | injectMousePress (int _absx, int _absy, MouseButton _id)
bool | injectMouseRelease (int _absx, int _absy, MouseButton _id)
bool | injectKeyPress (KeyCode _key, Char _text=0)
bool | injectKeyRelease (KeyCode _key)
bool | isFocusMouse () const
bool | isFocusKey () const
bool | isCaptureMouse () const
void | setKeyFocusWidget (Widget *_widget)
void | resetKeyFocusWidget (Widget *_widget)
void | resetKeyFocusWidget ()
Widget * | getMouseFocusWidget () const
Widget * | getKeyFocusWidget () const
const IntPoint & | getLastPressedPosition (MouseButton _id) const
const IntPoint & | getMousePosition () const
IntPoint | getMousePositionByLayer ()
void | addWidgetModal (Widget *_widget)
void | removeWidgetModal (Widget *_widget)
bool | isModalAny () const
bool | isControlPressed () const
bool | isShiftPressed () const
void | resetMouseCaptureWidget ()
void | unlinkWidget (Widget *_widget)
void | _resetMouseFocusWidget ()
Public Member Functions inherited from MyGUI::Singleton< InputManager >
| Singleton ()
virtual | ~Singleton ()
Public Member Functions inherited from MyGUI::IUnlinkWidget
virtual | ~IUnlinkWidget ()
Public Member Functions inherited from MyGUI::MemberObsolete< InputManager >
const IntPoint & | getLastLeftPressed () const
const IntPoint & | getLastRightPressed () const

## Data Fields
delegates::CMultiDelegate1< Widget * > | eventChangeMouseFocus
delegates::CMultiDelegate1< Widget * > | eventChangeKeyFocus

## Additional Inherited Members
Public Types inherited from MyGUI::Singleton< InputManager >
typedef Singleton< InputManager > | Base
Static Public Member Functions inherited from MyGUI::Singleton< InputManager >
static InputManager & | getInstance ()
static InputManager * | getInstancePtr ()
static const char * | getClassTypeName ()

## Detailed Description

Definition at line 27 of file MyGUI_InputManager.h.

## Constructor & Destructor Documentation

## ◆ InputManager()

MyGUI::InputManager::InputManager | ( |  | ) |

Definition at line 26 of file MyGUI_InputManager.cpp.

## Member Function Documentation

## ◆ _resetMouseFocusWidget()

void MyGUI::InputManager::_resetMouseFocusWidget | ( |  | ) |

Definition at line 436 of file MyGUI_InputManager.cpp.

## ◆ addWidgetModal()

void MyGUI::InputManager::addWidgetModal | ( | Widget * | _widget | ) |

Add modal widget - all other widgets inaccessible while modal widget exist

Definition at line 493 of file MyGUI_InputManager.cpp.

## ◆ getKeyFocusWidget()

Widget * MyGUI::InputManager::getKeyFocusWidget | ( |  | ) | const

Get key focused widget

Definition at line 633 of file MyGUI_InputManager.cpp.

## ◆ getLastPressedPosition()

const IntPoint & MyGUI::InputManager::getLastPressedPosition | ( | MouseButton | _id | ) | const

Get position of last mouse button press. Position calculated on specific layer where mouse was pressed.

Definition at line 638 of file MyGUI_InputManager.cpp.

## ◆ getMouseFocusWidget()

Widget * MyGUI::InputManager::getMouseFocusWidget | ( |  | ) | const

Get mouse focused widget

Definition at line 628 of file MyGUI_InputManager.cpp.

## ◆ getMousePosition()

const IntPoint & MyGUI::InputManager::getMousePosition | ( |  | ) | const

Get current mouse position on screen

Definition at line 647 of file MyGUI_InputManager.cpp.

## ◆ getMousePositionByLayer()

IntPoint MyGUI::InputManager::getMousePositionByLayer | ( |  | ) |

Get mouse position on current layer. This position might different from getMousePosition() if mouse is over non-2d layer.

Definition at line 596 of file MyGUI_InputManager.cpp.

## ◆ initialise()

void MyGUI::InputManager::initialise | ( |  | ) |

Definition at line 43 of file MyGUI_InputManager.cpp.

## ◆ injectKeyPress()

bool MyGUI::InputManager::injectKeyPress | ( | KeyCode | _key,
|  | Char | _text = `0`
| ) |  |

Inject KeyPress event

Returns
  true if event has been processed by GUI

Definition at line 339 of file MyGUI_InputManager.cpp.

## ◆ injectKeyRelease()

bool MyGUI::InputManager::injectKeyRelease | ( | KeyCode | _key | ) |

Inject KeyRelease event

Returns
  true if event has been processed by GUI

Definition at line 358 of file MyGUI_InputManager.cpp.

## ◆ injectMouseMove()

bool MyGUI::InputManager::injectMouseMove | ( | int | _absx,
|  | int | _absy,
|  | int | _absz
| ) |  |

Inject MouseMove event

Returns
  true if event has been processed by GUI

Definition at line 82 of file MyGUI_InputManager.cpp.

## ◆ injectMousePress()

bool MyGUI::InputManager::injectMousePress | ( | int | _absx,
|  | int | _absy,
|  | MouseButton | _id
| ) |  |

Inject MousePress event

Returns
  true if event has been processed by GUI

Definition at line 220 of file MyGUI_InputManager.cpp.

## ◆ injectMouseRelease()

bool MyGUI::InputManager::injectMouseRelease | ( | int | _absx,
|  | int | _absy,
|  | MouseButton | _id
| ) |  |

Inject MouseRelease event

Returns
  true if event has been processed by GUI

Definition at line 286 of file MyGUI_InputManager.cpp.

## ◆ isCaptureMouse()

bool MyGUI::InputManager::isCaptureMouse | ( |  | ) | const

Is any widget captured mouse

Definition at line 613 of file MyGUI_InputManager.cpp.

## ◆ isControlPressed()

bool MyGUI::InputManager::isControlPressed | ( |  | ) | const

Is control button pressed

Definition at line 657 of file MyGUI_InputManager.cpp.

## ◆ isFocusKey()

bool MyGUI::InputManager::isFocusKey | ( |  | ) | const

Is any widget have key focus (any widget might have it, not only EditBox or something similar)

Definition at line 608 of file MyGUI_InputManager.cpp.

## ◆ isFocusMouse()

bool MyGUI::InputManager::isFocusMouse | ( |  | ) | const

Is any widget have mouse focus

Definition at line 603 of file MyGUI_InputManager.cpp.

## ◆ isModalAny()

bool MyGUI::InputManager::isModalAny | ( |  | ) | const

Return true if any modal widget exist

Definition at line 652 of file MyGUI_InputManager.cpp.

## ◆ isShiftPressed()

bool MyGUI::InputManager::isShiftPressed | ( |  | ) | const

Is shift button pressed

Definition at line 662 of file MyGUI_InputManager.cpp.

## ◆ removeWidgetModal()

void MyGUI::InputManager::removeWidgetModal | ( | Widget * | _widget | ) |

Remove modal widget

Definition at line 507 of file MyGUI_InputManager.cpp.

## ◆ resetKeyFocusWidget() [1/2]

void MyGUI::InputManager::resetKeyFocusWidget | ( | Widget * | _widget | ) |

Drop key focus for _widget

Definition at line 590 of file MyGUI_InputManager.cpp.

## ◆ resetKeyFocusWidget() [2/2]

void MyGUI::InputManager::resetKeyFocusWidget | ( |  | ) |

Drop any key focus

Definition at line 623 of file MyGUI_InputManager.cpp.

## ◆ resetMouseCaptureWidget()

void MyGUI::InputManager::resetMouseCaptureWidget | ( |  | ) |

Reset mouse capture. For example when we dragging and application lost focus you should call this.

Definition at line 667 of file MyGUI_InputManager.cpp.

## ◆ setKeyFocusWidget()

void MyGUI::InputManager::setKeyFocusWidget | ( | Widget * | _widget | ) |

Set key focus for _widget

Definition at line 382 of file MyGUI_InputManager.cpp.

## ◆ shutdown()

void MyGUI::InputManager::shutdown | ( |  | ) |

Definition at line 70 of file MyGUI_InputManager.cpp.

## ◆ unlinkWidget()

void MyGUI::InputManager::unlinkWidget | ( | Widget * | _widget | ) |

Unlink widget from input manager.

Definition at line 675 of file MyGUI_InputManager.cpp.

## Field Documentation

## ◆ eventChangeKeyFocus

delegates::CMultiDelegate1<Widget*> MyGUI::InputManager::eventChangeKeyFocus

Event : MultiDelegate. Key focus was changed.
signature : void method(MyGUI::Widget* _widget)

Parameters

  _widget |

Definition at line 125 of file MyGUI_InputManager.h.

## ◆ eventChangeMouseFocus

delegates::CMultiDelegate1<Widget*> MyGUI::InputManager::eventChangeMouseFocus

Event : MultiDelegate. Mouse focus was changed.
signature : void method(MyGUI::Widget* _widget)

Parameters

  _widget |

Definition at line 119 of file MyGUI_InputManager.h.

The documentation for this class was generated from the following files:

- MyGUI_InputManager.h
- MyGUI_InputManager.cpp