_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Public Member Functions | Protected Member Functions | List of all members
gcn::KeyListener Class Reference

#include <keylistener.h>

Inheritance diagram for gcn::KeyListener:
gcn::Button gcn::CheckBox gcn::DropDown gcn::ListBox gcn::RadioButton gcn::Slider gcn::TextBox gcn::TextField LuaActionListener

Public Member Functions

virtual ~KeyListener ()
 
virtual bool keyPress (const Key &)
 
virtual bool keyRelease (const Key &)
 
virtual void hotKeyPress (const Key &)
 
virtual void hotKeyRelease (const Key &)
 

Protected Member Functions

 KeyListener ()
 

Detailed Description

Key listeners base class. 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.

See also
Widget::addKeyListener

Constructor & Destructor Documentation

◆ ~KeyListener()

virtual gcn::KeyListener::~KeyListener ( )
inlinevirtual

Destructor

◆ KeyListener()

gcn::KeyListener::KeyListener ( )
inlineprotected

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.

Member Function Documentation

◆ hotKeyPress()

virtual void gcn::KeyListener::hotKeyPress ( const Key )
inlinevirtual

Reimplemented in LuaActionListener.

◆ hotKeyRelease()

virtual void gcn::KeyListener::hotKeyRelease ( const Key )
inlinevirtual

Reimplemented in LuaActionListener.

◆ keyPress()

virtual bool gcn::KeyListener::keyPress ( const Key )
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
keythe key pressed.

Reimplemented in gcn::TextBox, gcn::Slider, gcn::DropDown, gcn::RadioButton, gcn::TextField, gcn::Button, gcn::CheckBox, gcn::ListBox, and LuaActionListener.

◆ keyRelease()

virtual bool gcn::KeyListener::keyRelease ( const Key )
inlinevirtual

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

Parameters
keythe key released.

Reimplemented in gcn::Button, and LuaActionListener.


The documentation for this class was generated from the following file:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.