libGumball 0.0.2
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_event_button.h
Go to the documentation of this file.
1#ifndef GUM_EVENT_BUTTON_H
2#define GUM_EVENT_BUTTON_H
3
4// View this file's documentation online: https://libgumball.psyops.studio/gumball__event__button_8h.html
5
6/*! \file
7 * \ingroup events
8 *
9 * Event type for gamepad button events
10 *
11 * \author 2025 Agustín Bellagamba
12 * \copyright MIT License
13*/
14
16
17/*! \name Type System
18 * \brief Type UUID and Cast Operators
19 * @{
20*/
21#define GUM_EVENT_BUTTON_TYPE (GBL_TYPEID (GUM_Event_Button)) //!< Returns the GUM_Event_Button Type UUID
22#define GUM_EVENT_BUTTON(self) (GBL_CAST (GUM_Event_Button, self)) //!< Casts an instance of a compatible event to a GUM_Event_Button
23#define GUM_EVENT_BUTTON_CLASS(klass) (GBL_CLASS_CAST (GUM_Event_Button, klass)) //!< Casts a class of a compatible event to a GUM_Event_ButtonClass
24#define GUM_EVENT_BUTTON_CLASSOF(self) (GBL_CLASSOF (GUM_Event_Button, self)) //!< Casts an instance of a compatible event to a GUM_Event_ButtonClass
25//! @}
26
27#define GBL_SELF_TYPE GUM_Event_Button
28
29GBL_DECLS_BEGIN
30GBL_FORWARD_DECLARE_STRUCT(GUM_Event_Button);
31z
32/*! \struct GUM_Event_ButtonClass
33 * \extends GUM_EventClass
34 * \brief GUM_Event_Button class
35 *
36 * GUM_Event_ButtonClass derives from GUM_EventClass, adding nothing new.
37*/
38GBL_CLASS_DERIVE_EMPTY(GUM_Event_Button, GUM_Event_Input);
39
40/*!
41 * \class GUM_Event_Button
42 * \extends GUM_Event
43 * \brief Gamepad button event
44 *
45 * GUM_Event_Button represents any gamepad button event, such as pressing or releasing a controller button.
46 *
47*/
48GBL_INSTANCE_DERIVE(GUM_Event_Button, GUM_Event_Input)
49 uint8_t controllerId; //!< ID of the controller that generated the event
50GBL_INSTANCE_END
51
52#endif
GBL_INSTANCE_DERIVE(GUM_Event_Button, GUM_Event_Input) uint8_t controllerId
ID of the controller that generated the event.
GUM_Event_Button class.