SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | List of all members
sgl::KeyEvent Class Reference

This class defines a key event, created by the KeyCallback. More...

#include <event.hpp>

Inheritance diagram for sgl::KeyEvent:
sgl::Event

Public Member Functions

 KeyEvent (Key key, int scancode, Action action, Modifier mods)
 Creates a new key event. More...
 
 ~KeyEvent (void) override
 Deletes a key event. More...
 
Key getKey ()
 Returns the key of the event. More...
 
int getScancode ()
 Returns the system-specific scancode for the key. More...
 
Action getAction ()
 Returns the action of the event. More...
 
Modifier getMods ()
 Returns the modifier bits of the event. More...
 
- Public Member Functions inherited from sgl::Event
 Event (EventType type)
 Creates a new event. More...
 
virtual ~Event (void)
 Deletes a event. More...
 
EventType getType ()
 Returns the event type. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sgl::Event
static std::vector< Event * > getEvents ()
 Returns the list of events. More...
 
static void addEvent (Event *event)
 Adds an event to the list. More...
 
static void clearEvents ()
 Clears the event list, this should be called after every loop. More...
 
- Protected Attributes inherited from sgl::Event
EventType type
 Stores the event type. More...
 
- Static Protected Attributes inherited from sgl::Event
static std::vector< Event * > events
 Stores the events that got received. More...
 

Detailed Description

This class defines a key event, created by the KeyCallback.

Definition at line 92 of file event.hpp.

Constructor & Destructor Documentation

sgl::KeyEvent::KeyEvent ( Key  key,
int  scancode,
Action  action,
Modifier  mods 
)

Creates a new key event.

Parameters
keyThe key of the event.
scancodeThe system-specific scancode for the key.
actionThe action of the event.
modsA bit field that describes which modifier keys were active.

Definition at line 41 of file event.cpp.

sgl::KeyEvent::~KeyEvent ( void  )
override

Deletes a key event.

Definition at line 47 of file event.cpp.

Member Function Documentation

Action sgl::KeyEvent::getAction ( )

Returns the action of the event.

Returns
The action of the event.

Definition at line 59 of file event.cpp.

Key sgl::KeyEvent::getKey ( )

Returns the key of the event.

Returns
The key of the event.

Definition at line 51 of file event.cpp.

Modifier sgl::KeyEvent::getMods ( )

Returns the modifier bits of the event.

Returns
The modifier bits of the event.

Definition at line 63 of file event.cpp.

int sgl::KeyEvent::getScancode ( )

Returns the system-specific scancode for the key.

Returns
The system-specific scancode for the key.

Definition at line 55 of file event.cpp.


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