QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
Quasar::GamepadConnectedEvent Class Referencefinal

Sent when a gamepad is connected, or when it is already connected as the application starts. More...

#include <quasar/events/GamepadEvent.h>

Inheritance diagram for Quasar::GamepadConnectedEvent:
Quasar::EventOf< EventType::GamepadConnected, EventCategory::Gamepad > Quasar::Event

Public Member Functions

 GamepadConnectedEvent (GamepadId gamepad, std::string name)
 Creates the event for the connected gamepad.
GamepadId GetGamepad () const
 Returns the id of the gamepad.
const std::string & GetGamepadName () const
 Returns the name of the gamepad.
std::string ToString () const override
 Returns the event with the id and the name, for example "GamepadConnected: 0 (Xbox Controller)".
Public Member Functions inherited from Quasar::EventOf< EventType::GamepadConnected, EventCategory::Gamepad >
EventType GetType () const override
 Returns the type of the event.
EventCategory GetCategories () const override
 Returns all the categories of the event.
Public Member Functions inherited from Quasar::Event
const char * GetName () const
 Returns the name of the type of the event, for example "KeyPressed".
bool IsInCategory (EventCategory category) const
 Returns true if the event belongs to the given category.
bool IsHandled () const
 Returns true if the event was handled.
void SetHandled (bool handled)
 Marks the event as handled, or not handled.

Additional Inherited Members

Static Public Member Functions inherited from Quasar::EventOf< EventType::GamepadConnected, EventCategory::Gamepad >
static constexpr EventType GetStaticType ()
 Returns the type of this event class.
Protected Member Functions inherited from Quasar::Event
 Event ()=default
 Creates an event that is not handled.

Detailed Description

Sent when a gamepad is connected, or when it is already connected as the application starts.

Constructor & Destructor Documentation

◆ GamepadConnectedEvent()

Quasar::GamepadConnectedEvent::GamepadConnectedEvent ( GamepadId gamepad,
std::string name )
inline

Creates the event for the connected gamepad.

Parameters
gamepadThe id that the gamepad keeps while it stays connected.
nameThe name of the gamepad, for example "Xbox Controller".

Member Function Documentation

◆ ToString()

std::string Quasar::GamepadConnectedEvent::ToString ( ) const
inlineoverridevirtual

Returns the event with the id and the name, for example "GamepadConnected: 0 (Xbox Controller)".

Reimplemented from Quasar::Event.


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