# HEventInfo

## Fields

const int | `MAX_TOUCHES`

## Functions

| `HEventInfo`
bool | `Control`
bool | `Shift`
bool | `Alt`
bool | `LeftAlt`
bool | `LeftControl`
bool | `LeftShift`
bool | `RightAlt`
bool | `RightControl`
bool | `RightShift`
bool | `LButton`
bool | `MButton`
bool | `RButton`
bool | `LeftArrow`
bool | `UpArrow`
bool | `RightArrow`
bool | `DownArrow`
HBaseView * | `GetView`
const HPoint & | `GetMousePixelPos`
const HPoint & | `GetMouseWindowPos`
const HPoint & | `GetMouseWorldPos`
const HPoint & | `GetMouseViewpointPos`
const HPoint & | `GetJoystickRotation`
const HPoint & | `GetJoystickTranslation`
unsigned int | `GetChar`
unsigned int | `GetCharRepCount`
unsigned int | `GetTimerId`
unsigned int | `GetFlags`
void | `SetType`
`HEventType` | `GetType`
void | `SetPoint`
void | `SetPixelPos`
void | `SetWindowPos`
void | `SetWorldPos`
void | `SetViewpointPos`
void | `SetKey`
void | `SetTimer`
void | `SetMouseWheelDelta`
void | `SetFlags`
int | `GetMouseWheelDelta`

## Detailed Description

class HEventInfo

  The HEventInfo class stores and manages event information.

  HEventInfo encapusulates information associated with an event, including the type (timer, key press, or button), location in various coordinates systems, mouse state, and key press state. This is the primary MVO object that receives event information from the user interface.

  Public Functions

  HEventInfo(HBaseView *view)

    Constructs an HEventInfo object.

    Parameters

      view – A pointer to the HBaseView object.

  inline bool Control() const
    Returns

      True if the control key is currently depressed.

  inline bool Shift() const
    Returns

      True if the shift key is currently depressed.

  inline bool Alt() const
    Returns

      True if the alt key is currently depressed.

  inline bool LeftAlt() const
    Returns

      True if the left alt key is depressed.

  inline bool LeftControl() const
    Returns

      True if the left control key is depressed.

  inline bool LeftShift() const
    Returns

      True if the left shift key is depressed.

  inline bool RightAlt() const
    Returns

      True if the right alt key is depressed.

  inline bool RightControl() const
    Returns

      True if the right control key is depressed.

  inline bool RightShift() const
    Returns

      True if the right shift key is depressed.

  inline bool LButton() const
    Returns

      True if the left mouse button is depressed.

  inline bool MButton() const
    Returns

      True if the middle mouse button is depressed.

  inline bool RButton() const
    Returns

      True if the right mouse button is depressed.

  inline bool LeftArrow() const
    Returns

      True if the left arrow key is depressed.

  inline bool UpArrow() const
    Returns

      True if the up arrow key is depressed.

  inline bool RightArrow() const
    Returns

      True if the right arrow key is depressed.

  inline bool DownArrow() const
    Returns

      True if the down arrow key is depressed.

  inline HBaseView *GetView() const
    Returns

      A pointer to the HBaseView object.

  inline const HPoint &GetMousePixelPos() const
    Returns

      The mouse position in pixel coordinates.

  inline const HPoint &GetMouseWindowPos() const
    Returns

      The mouse position in window coordinates.

  inline const HPoint &GetMouseWorldPos() const
    Returns

      The mouse position in world coordinates.

  inline const HPoint &GetMouseViewpointPos() const
    Returns

      The mouse position in viewpoint (camera) coordinates.

  inline const HPoint &GetJoystickRotation() const
    Returns

      The rotation data from the Joystick or 3D Mouse.

  inline const HPoint &GetJoystickTranslation() const
    Returns

      The translation data from the Joystick or 3D Mouse.

  inline unsigned int GetChar() const
    Returns

      The key character associated with a keypress event.

  inline unsigned int GetCharRepCount() const
    Returns

      The number of times the key press event was repeated.

  inline unsigned int GetTimerId() const
    Returns

      The Id number of the current timer event.

  inline unsigned int GetFlags() const
    Returns

      The MVO-specific bit flags like #MVO_LBUTTON for the special key events shift, control, and Left, Middle, and Right mouse buttons.

  inline void SetType(HEventType NewType)

    This method sets the event type on the HEventInfo object.

  inline HEventType GetType() const
    Returns

      The event type associated to this HEventInfo.

  void SetPoint(HEventType NewType, int x, int y, unsigned int NewFlags)

    This method receives and stores mouse event information from the user interface and translates it for use by HOOPS functions.

    Parameters

      - NewType – The type of event.

      - x – The X coordinate of the mouse event, in window space.

      - y – The Y coordinate of the mouse event, in window space.

      - NewFlags – The bitwise MVO flags for mouse buttons, shift and control Key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  void SetPixelPos(HEventType NewType, const HPoint &NewPoint, unsigned int NewFlags)

    This method receives and stores mouse event information in pixel coordinates and translates it for use by HOOPS functions.

    Parameters

      - NewType – The type of event.

      - NewPoint – The point in pixel coordinates.

      - NewFlags – The bitwise MVO flags for mouse buttons, shift and control Key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  void SetWindowPos(HEventType NewType, const HPoint &NewPoint, unsigned int NewFlags)

    This method receives and stores mouse event information in window coordinates and translates it for use by HOOPS functions.

    Parameters

      - NewType – The type of event

      - NewPoint – The point in window coordinates.

      - NewFlags – The bitwise MVO flags for mouse buttons, shift and control Key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  void SetWorldPos(HEventType NewType, const HPoint &NewPoint, unsigned int NewFlags)

    This method receives and stores mouse event information in world coordinates and translates it for use by HOOPS functions.

    Parameters

      - NewType – The type of event.

      - NewPoint – The point in world coordinates.

      - NewFlags – The bitwise MVO flags for mouse buttons, shift and control Key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  void SetViewpointPos(HEventType NewType, const HPoint &NewPoint, unsigned int NewFlags)

    This method receives and stores mouse event information in viewpoint (camera) coordinates and translates it for use in by HOOPS functions.

    Parameters

      - NewType – The type of event

      - NewPoint – The point in viewpoint coordinates.

      - NewFlags – The bitwise MVO flags for mouse buttons, shift and control Key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  void SetKey(HEventType NewType, unsigned int nChar, unsigned int nRepCnt, unsigned int NewFlags)

    This method receives and stores key event information from the user interface.

    Parameters

      - NewType – The type of event.

      - nChar – The key character that is currently depressed.

      - nRepCnt – The number of times the event has been repeated.

      - NewFlags – The bitwise MVO flags for mouse buttons, shift and control Key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  void SetTimer(HEventType NewType, unsigned int nIDEvent)

    This method receives and stores timer event information from the user interface.

    Parameters

      - NewType – The type of event.

      - nIDEvent – The timer ID number generated by the UI.

  void SetMouseWheelDelta(int NewWheelDelta)

    This method sets the change value in the Mouse Wheel.

    Parameters

      NewWheelDelta – The new mouse wheel change value.

  inline void SetFlags(int flags)

    This method sets the bitwise flags that indicates the state of the mouse buttons, shift and control keys.

    Parameters

      flags – The bitwise flags for mouse and key states. For example, if both the shift key and left mouse button are depressed, pass #MVO_SHIFT|#MVO_LBUTTON.

  inline int GetMouseWheelDelta() const
    Returns

      The change value of the mouse wheel position.

  Public Static Attributes

  static const int MAX_TOUCHES = 10

    default = 10