Isle
Loading...
Searching...
No Matches
LegoEventNotificationParam Class Reference

Notification parameter class for LEGO event notifications such as mouse events and modifier keys. More...

#include <legoeventnotificationparam.h>

Inheritance diagram for LegoEventNotificationParam:
Collaboration diagram for LegoEventNotificationParam:

Public Types

enum  { c_lButtonState = 1 , c_rButtonState = 2 , c_modKey1 = 4 , c_modKey2 = 8 }
 Modifier and mouse button state bit-flag values for user input. More...
 

Public Member Functions

MxNotificationParamClone () const override
 Creates a deep copy of this notification parameter object. More...
 
 LegoEventNotificationParam ()
 Default constructor. More...
 
 LegoEventNotificationParam (NotificationId p_type, MxCore *p_sender, MxU8 p_modifier, MxS32 p_x, MxS32 p_y, MxU8 p_key)
 Constructor with all parameter fields for event reporting. More...
 
LegoROIGetROI ()
 Returns the ROI (3D Object) associated with this event, if any. More...
 
MxU8 GetModifier ()
 Returns modifier bitmask for this event (mouse/keyboard state). More...
 
MxU8 GetKey () const
 Returns the keycode for this event, or 0 if not used. More...
 
MxS32 GetX () const
 Returns X (horizontal) coordinate for the event, usually screen-relative in pixels. More...
 
MxS32 GetY () const
 Returns Y (vertical) coordinate for the event, usually screen-relative in pixels. More...
 
void SetROI (LegoROI *p_roi)
 Sets the ROI reference (object involved in the event). More...
 
void SetModifier (MxU8 p_modifier)
 Sets the modifier state bitmask for the event. More...
 
void SetKey (MxU8 p_key)
 Sets the keycode for the event. More...
 
void SetX (MxS32 p_x)
 Sets the X (horizontal) coordinate for the event. More...
 
void SetY (MxS32 p_y)
 Sets the Y (vertical) coordinate for the event. More...
 
- Public Member Functions inherited from MxNotificationParam
 MxNotificationParam ()
 [AI] Constructs a default notification parameter with type c_notificationType0 and no sender. More...
 
 MxNotificationParam (NotificationId p_type, MxCore *p_sender)
 [AI] Constructs a notification parameter with a specific type and sender. More...
 
virtual MxNotificationParamClone () const
 [AI] Creates a copy of this notification parameter object on the heap. More...
 
NotificationId GetNotification () const
 [AI] Retrieves the current notification type of this parameter. More...
 
MxCoreGetSender () const
 [AI] Retrieves the sender pointer associated with this notification. More...
 
void SetNotification (NotificationId p_type)
 [AI] Sets the notification type for this parameter object. More...
 
void SetSender (MxCore *p_sender)
 [AI] Sets the sender pointer for this notification parameter. More...
 
- Public Member Functions inherited from MxParam
virtual ~MxParam ()
 [AI] Virtual destructor for safe polymorphic deletion of derived parameter objects. More...
 

Protected Attributes

MxU8 m_modifier
 Bitmask of button/modifier state at the time of the event. More...
 
MxS32 m_x
 X position (horizontal pixel coordinate) for event, typically relative to window/screen. More...
 
MxS32 m_y
 Y position (vertical pixel coordinate) for event, typically relative to window/screen. More...
 
MxU8 m_key
 Key code of event, if any (else 0). More...
 
LegoROIm_roi
 Reference to involved world object (ROI), if any (else NULL). More...
 
- Protected Attributes inherited from MxNotificationParam
NotificationId m_type
 [AI] Type of notification/event carried by this object (see NotificationId). More...
 
MxCorem_sender
 [AI] Pointer to the MxCore instance that sent or originated this notification. More...
 

Detailed Description

Notification parameter class for LEGO event notifications such as mouse events and modifier keys.

[AI]

[AI] Handles mouse position, button/modifier state, key events, and optionally associates with a LegoROI for the event. Used to pass user input details through the event/notification systems of the LEGO Island engine.

Definition at line 18 of file legoeventnotificationparam.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Modifier and mouse button state bit-flag values for user input.

[AI]

[AI] Used in m_modifier: left/right mouse buttons and up to two modifier keys can be represented. c_lButtonState: Indicates (bit 0) left mouse button is pressed. c_rButtonState: Indicates (bit 1) right mouse button is pressed. c_modKey1: Indicates (bit 2) a modifier key (e.g., Shift) is pressed. c_modKey2: Indicates (bit 3) another modifier key (e.g., Ctrl) is pressed.

Enumerator
c_lButtonState 
c_rButtonState 
c_modKey1 
c_modKey2 

Definition at line 29 of file legoeventnotificationparam.h.

Constructor & Destructor Documentation

◆ LegoEventNotificationParam() [1/2]

LegoEventNotificationParam::LegoEventNotificationParam ( )
inline

Default constructor.

Sets type to c_notificationType0 and sender to NULL; all data to default/zero. [AI]

Definition at line 53 of file legoeventnotificationparam.h.

◆ LegoEventNotificationParam() [2/2]

LegoEventNotificationParam::LegoEventNotificationParam ( NotificationId  p_type,
MxCore p_sender,
MxU8  p_modifier,
MxS32  p_x,
MxS32  p_y,
MxU8  p_key 
)
inline

Constructor with all parameter fields for event reporting.

[AI]

Parameters
p_typeNotification type (event type enum, e.g. mouse, key event) [AI]
p_senderPointer to the sender object (usually the input handler or direct control object) [AI]
p_modifierModifier bitmask (from enum, combines l/r mouse and modifiers) [AI]
p_xMouse X coordinate [AI]
p_yMouse Y coordinate [AI]
p_keyKeycode for the key event; 0 if unused [AI]

Definition at line 64 of file legoeventnotificationparam.h.

Member Function Documentation

◆ Clone()

MxNotificationParam * LegoEventNotificationParam::Clone ( ) const
inlineoverridevirtual

Creates a deep copy of this notification parameter object.

[AI]

[AI] Returns a new LegoEventNotificationParam with identical members, including the associated ROI pointer. Used for forwarding or queuing input events. [AI]

Returns
A heap-allocated clone of this instance as MxNotificationParam*. [AI]

Reimplemented from MxNotificationParam.

Definition at line 42 of file legoeventnotificationparam.h.

◆ GetKey()

MxU8 LegoEventNotificationParam::GetKey ( ) const
inline

Returns the keycode for this event, or 0 if not used.

[AI]

[AI] Represents keyboard input; if not a key event, will be 0. [AI]

Definition at line 90 of file legoeventnotificationparam.h.

◆ GetModifier()

MxU8 LegoEventNotificationParam::GetModifier ( )
inline

Returns modifier bitmask for this event (mouse/keyboard state).

[AI]

[AI] Bitmask with possible bit flags from enum {c_lButtonState, ...}. [AI]

Definition at line 85 of file legoeventnotificationparam.h.

◆ GetROI()

LegoROI * LegoEventNotificationParam::GetROI ( )
inline

Returns the ROI (3D Object) associated with this event, if any.

[AI]

[AI] May be null. Used if the event occurred on a specific world object. [AI]

Definition at line 80 of file legoeventnotificationparam.h.

◆ GetX()

MxS32 LegoEventNotificationParam::GetX ( ) const
inline

Returns X (horizontal) coordinate for the event, usually screen-relative in pixels.

[AI]

Definition at line 95 of file legoeventnotificationparam.h.

◆ GetY()

MxS32 LegoEventNotificationParam::GetY ( ) const
inline

Returns Y (vertical) coordinate for the event, usually screen-relative in pixels.

[AI]

Definition at line 100 of file legoeventnotificationparam.h.

◆ SetKey()

void LegoEventNotificationParam::SetKey ( MxU8  p_key)
inline

Sets the keycode for the event.

[AI]

Parameters
p_keyKeycode to assign. [AI]

Definition at line 118 of file legoeventnotificationparam.h.

◆ SetModifier()

void LegoEventNotificationParam::SetModifier ( MxU8  p_modifier)
inline

Sets the modifier state bitmask for the event.

[AI]

Parameters
p_modifierModifier mask (from enum) to set. [AI]

Definition at line 112 of file legoeventnotificationparam.h.

◆ SetROI()

void LegoEventNotificationParam::SetROI ( LegoROI p_roi)
inline

Sets the ROI reference (object involved in the event).

[AI]

Parameters
p_roiPointer to a LegoROI to associate; can be NULL. [AI]

Definition at line 106 of file legoeventnotificationparam.h.

◆ SetX()

void LegoEventNotificationParam::SetX ( MxS32  p_x)
inline

Sets the X (horizontal) coordinate for the event.

[AI]

Parameters
p_xNew X coordinate. [AI]

Definition at line 124 of file legoeventnotificationparam.h.

◆ SetY()

void LegoEventNotificationParam::SetY ( MxS32  p_y)
inline

Sets the Y (vertical) coordinate for the event.

[AI]

Parameters
p_yNew Y coordinate. [AI]

Definition at line 130 of file legoeventnotificationparam.h.

Member Data Documentation

◆ m_key

MxU8 LegoEventNotificationParam::m_key
protected

Key code of event, if any (else 0).

[AI]

Definition at line 152 of file legoeventnotificationparam.h.

◆ m_modifier

MxU8 LegoEventNotificationParam::m_modifier
protected

Bitmask of button/modifier state at the time of the event.

[AI]

[AI] See enum above for interpretation: lButton, rButton, modKey1, modKey2. [AI]

Definition at line 137 of file legoeventnotificationparam.h.

◆ m_roi

LegoROI* LegoEventNotificationParam::m_roi
protected

Reference to involved world object (ROI), if any (else NULL).

[AI]

Definition at line 157 of file legoeventnotificationparam.h.

◆ m_x

MxS32 LegoEventNotificationParam::m_x
protected

X position (horizontal pixel coordinate) for event, typically relative to window/screen.

[AI]

Definition at line 142 of file legoeventnotificationparam.h.

◆ m_y

MxS32 LegoEventNotificationParam::m_y
protected

Y position (vertical pixel coordinate) for event, typically relative to window/screen.

[AI]

Definition at line 147 of file legoeventnotificationparam.h.


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