nomlib
Loading...
Searching...
No Matches
nom::MouseButtonAction Struct Reference

A structure containing information on a mouse button action. More...

#include <InputAction.hpp>

Inheritance diagram for nom::MouseButtonAction:
[legend]

Public Member Functions

 MouseButtonAction (uint8 button, InputState state=InputState::PRESSED)
 Constructor for initializing an object to a valid action state.
 MouseButtonAction (uint8 button, uint8 clicks, InputState state=InputState::PRESSED)
 Constructor for initializing an object to a valid action state.
Public Member Functions inherited from nom::InputAction
 InputAction ()
 Default constructor; constructs an invalid action state.
virtual const Eventevent (void) const
 Get the underlying event associated with the input action.
const nom::event_callback & callback (void) const
 Get the callback assigned to the input action.
void set_callback (const nom::event_callback &delegate)
void operator() (const Event &evt) const
 C++ functor; execute the callback assigned for the input action.

Additional Inherited Members

Public Attributes inherited from nom::InputAction
Event event_
 The event type and relevant input data; the criteria is used to match against user input.

Detailed Description

A structure containing information on a mouse button action.

Todo
Implement nom::MouseButtonEvent's id field (to differentiate between events generated by a touch input device and those generated by a real mouse device).

Definition at line 107 of file InputAction.hpp.

Constructor & Destructor Documentation

◆ MouseButtonAction() [1/2]

nom::MouseButtonAction::MouseButtonAction ( uint8 button,
InputState state = InputState::PRESSED )

Constructor for initializing an object to a valid action state.

Parameters
buttonOne of the nom::MouseButton enumeration values.
stateOne of the nom::InputState enumeration values.
Remarks
The number of mouse button clicks for this action will be initialized to one (a single mouse button click).

◆ MouseButtonAction() [2/2]

nom::MouseButtonAction::MouseButtonAction ( uint8 button,
uint8 clicks,
InputState state = InputState::PRESSED )

Constructor for initializing an object to a valid action state.

Parameters
buttonOne of the nom::MouseButton enumeration values.
stateOne of the nom::InputState enumeration values.
clicksThe number of button clicks to react on; one (1) for a single-click, two (2) for a double-click, three (3) for a triple-click, and so on (hardware-dependent).

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