FifeGUI 0.2.0
A C++ GUI library designed for games.
fcn::KeyEvent Class Reference

#include <keyevent.hpp>

Inheritance diagram for fcn::KeyEvent:
fcn::InputEvent fcn::Event

Public Types

enum class  Type : std::uint8_t { Pressed = 0 , Released }

Public Member Functions

Key const & getKey () const
Type getType () const
bool isNumericPad () const
 KeyEvent (Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed, Type type, bool isNumericPad, Key const &key)
Public Member Functions inherited from fcn::InputEvent
void consume ()
WidgetgetDistributor () const
 InputEvent (Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed)
bool isAltPressed () const
bool isConsumed () const
bool isControlPressed () const
bool isMetaPressed () const
bool isShiftPressed () const
Public Member Functions inherited from fcn::Event
 Event (Widget *source)
WidgetgetSource () const

Protected Attributes

bool mIsNumericPad
Key mKey
Type mType
Protected Attributes inherited from fcn::InputEvent
bool mAltPressed
bool mControlPressed
WidgetmDistributor
bool mIsConsumed
bool mMetaPressed
bool mShiftPressed
Protected Attributes inherited from fcn::Event
WidgetmSource {nullptr}

Detailed Description

Represents a key event.

Definition at line 21 of file keyevent.hpp.

Member Enumeration Documentation

◆ Type

enum class fcn::KeyEvent::Type : std::uint8_t
strong

Key event types.

Definition at line 27 of file keyevent.hpp.

Constructor & Destructor Documentation

◆ KeyEvent()

fcn::KeyEvent::KeyEvent ( Widget * source,
Widget * distributor,
bool isShiftPressed,
bool isControlPressed,
bool isAltPressed,
bool isMetaPressed,
Type type,
bool isNumericPad,
Key const & key )

Constructor.

Parameters
sourceThe widget the event concerns..
distributorThe distributor of the event.
isShiftPressedTrue if shift is pressed, false otherwise.
isControlPressedTrue if control is pressed, false otherwise.
isAltPressedTrue if alt is pressed, false otherwise.
isMetaPressedTrue if meta is pressed, false otherwise.
typeThe type of the event. A value from KeyEventType.
isNumericPadTrue if the event occurred on the numeric pad, false otherwise.
keyThe key of the event.

Definition at line 12 of file keyevent.cpp.

References fcn::InputEvent::InputEvent(), fcn::InputEvent::isAltPressed(), fcn::InputEvent::isControlPressed(), fcn::InputEvent::isMetaPressed(), isNumericPad(), fcn::InputEvent::isShiftPressed(), mIsNumericPad, mKey, and mType.

Member Function Documentation

◆ getKey()

◆ getType()

KeyEvent::Type fcn::KeyEvent::getType ( ) const

Gets the type of the event.

Returns
The type of the event.

Definition at line 29 of file keyevent.cpp.

References mType.

Referenced by fcn::Gui::distributeKeyEvent(), and fcn::Gui::distributeKeyEventToGlobalKeyListeners().

◆ isNumericPad()

bool fcn::KeyEvent::isNumericPad ( ) const

Checks if the key event occurred on the numeric pad.

Returns
True if key event occurred on the numeric pad, false otherwise.

Definition at line 34 of file keyevent.cpp.

References mIsNumericPad.

Referenced by KeyEvent().

Member Data Documentation

◆ mIsNumericPad

bool fcn::KeyEvent::mIsNumericPad
protected

True if the numeric pad was used, false otherwise.

Definition at line 90 of file keyevent.hpp.

Referenced by isNumericPad(), and KeyEvent().

◆ mKey

Key fcn::KeyEvent::mKey
protected

Holds the key of the key event.

Definition at line 95 of file keyevent.hpp.

Referenced by getKey(), and KeyEvent().

◆ mType

Type fcn::KeyEvent::mType
protected

Holds the type of the key event.

Definition at line 85 of file keyevent.hpp.

Referenced by getType(), and KeyEvent().


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