#include <keylistener.hpp>
Inheritance diagram for gcn::KeyListener:
Inorder to use this class you must inherit from it and implements it's functions. KeyListeners listen for key events on a Widgets. When a Widget recives a key event, the corresponding function in all it's key listeners will be called. Only focused Widgets will generate key events.
Definition at line 75 of file keylistener.hpp.
Public Member Functions | |
virtual | ~KeyListener () |
Destructor. | |
virtual void | keyPress (const Key &key) |
Called if a key is pressed when the widget has keyboard focus. | |
virtual void | keyRelease (const Key &key) |
Called if a key is released when the widget has keyboard focus. | |
Protected Member Functions | |
KeyListener () | |
Constructor. |
gcn::KeyListener::KeyListener | ( | ) | [inline, protected] |
Constructor.
You should not be able to make an instance of KeyListener, therefore its constructor is protected. To use KeyListener you must inherit from this class and implement it's functions.
Definition at line 109 of file keylistener.hpp.
virtual void gcn::KeyListener::keyPress | ( | const Key & | key | ) | [inline, virtual] |
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.
key | the key pressed. |
Reimplemented in gcn::Button, gcn::CheckBox, gcn::DropDown, gcn::ListBox, gcn::RadioButton, gcn::Slider, gcn::TextBox, and gcn::TextField.
Definition at line 91 of file keylistener.hpp.
virtual void gcn::KeyListener::keyRelease | ( | const Key & | key | ) | [inline, virtual] |
Called if a key is released when the widget has keyboard focus.
key | the key released. |
Reimplemented in gcn::Button.
Definition at line 98 of file keylistener.hpp.