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

#include <keylistener.hpp>

Inheritance diagram for fcn::KeyListener:
fcn::Button fcn::DropDown fcn::ListBox fcn::Slider fcn::TabbedArea fcn::TextBox fcn::TextField fcn::ImageButton fcn::PasswordField fcn::CheckBox fcn::ToggleButton fcn::RadioButton

Public Member Functions

 KeyListener (KeyListener &&)=default
 KeyListener (KeyListener const &)=default
virtual void keyPressed (KeyEvent &keyEvent)
virtual void keyReleased (KeyEvent &keyEvent)
KeyListener & operator= (KeyListener &&)=default
KeyListener & operator= (KeyListener const &)=default

Protected Member Functions

 KeyListener ()=default

Detailed Description

Interface for listening to keyboard events.

See also
Widget::addKeyListener, Widget::removeKeyListener

Definition at line 22 of file keylistener.hpp.

Constructor & Destructor Documentation

◆ KeyListener()

fcn::KeyListener::KeyListener ( )
protecteddefault

Constructor.

Instances should not be created directly, therefore the constructor is declared protected.

Member Function Documentation

◆ keyPressed()

virtual void fcn::KeyListener::keyPressed ( KeyEvent & keyEvent)
inlinevirtual

Called if a key is pressed when the widget has keyboard focus.

If a key is held down the widget will generate multiple key presses.

Parameters
keyEventDescribes the event.

Reimplemented in fcn::Button, fcn::CheckBox, fcn::DropDown, fcn::ListBox, fcn::PasswordField, fcn::Slider, fcn::TabbedArea, fcn::TextBox, and fcn::TextField.

Definition at line 39 of file keylistener.hpp.

◆ keyReleased()

virtual void fcn::KeyListener::keyReleased ( KeyEvent & keyEvent)
inlinevirtual

Called if a key is released when the widget has keyboard focus.

Parameters
keyEventDescribes the event.

Reimplemented in fcn::Button, fcn::CheckBox, and fcn::ToggleButton.

Definition at line 46 of file keylistener.hpp.


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