____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <key.h>
Definition at line 71 of file key.h.
| anonymous enum |
An enum with key values.
| gcn::Key::Key | ( | ) |
Constructor.
Definition at line 63 of file key.cpp.
References mAltPressed, mControlPressed, mMetaPressed, mNumericPad, mShiftPressed, and mValue.
| gcn::Key::Key | ( | int | value | ) |
Constructor.
| value | the ascii or enum value for the key. |
Definition at line 73 of file key.cpp.
References mAltPressed, mControlPressed, mMetaPressed, mNumericPad, mShiftPressed, and mValue.
| bool gcn::Key::isCharacter | ( | ) | const |
Checks whether a key is a character.
Definition at line 83 of file key.cpp.
References mValue.
Referenced by gcn::TextField::keyPress(), and gcn::TextBox::keyPress().
| bool gcn::Key::isNumber | ( | ) | const |
| bool gcn::Key::isLetter | ( | ) | const |
| bool gcn::Key::isShiftPressed | ( | ) | const |
Checks whether shift is pressed.
Definition at line 103 of file key.cpp.
References mShiftPressed.
Referenced by gcn::TextField::keyPress(), and gcn::Gui::logic().
| void gcn::Key::setShiftPressed | ( | bool | pressed | ) |
Sets the shift pressed flag.
| pressed | the shift flag value. |
Definition at line 108 of file key.cpp.
References mShiftPressed.
Referenced by gcn::SDLInput::convertKeyCharacter().
| bool gcn::Key::isControlPressed | ( | ) | const |
Checks whether control is pressed.
Definition at line 113 of file key.cpp.
References mControlPressed.
| void gcn::Key::setControlPressed | ( | bool | pressed | ) |
Sets the control pressed flag.
| pressed | the control flag value. |
Definition at line 118 of file key.cpp.
References mControlPressed.
Referenced by gcn::SDLInput::convertKeyCharacter().
| bool gcn::Key::isAltPressed | ( | ) | const |
Checks whether alt is pressed.
Definition at line 123 of file key.cpp.
References mAltPressed.
| void gcn::Key::setAltPressed | ( | bool | pressed | ) |
Sets the alt pressed flag.
| pressed | the alt flag value. |
Definition at line 128 of file key.cpp.
References mAltPressed.
Referenced by gcn::SDLInput::convertKeyCharacter().
| bool gcn::Key::isMetaPressed | ( | ) | const |
Checks whether meta is pressed.
Definition at line 133 of file key.cpp.
References mMetaPressed.
| void gcn::Key::setMetaPressed | ( | bool | pressed | ) |
Sets the meta pressed flag.
| pressed | the meta flag value. |
Definition at line 138 of file key.cpp.
References mMetaPressed.
Referenced by gcn::SDLInput::convertKeyCharacter().
| bool gcn::Key::isNumericPad | ( | ) | const |
Checks whether the key was pressed at the numeric pad.
Definition at line 143 of file key.cpp.
References mNumericPad.
| void gcn::Key::setNumericPad | ( | bool | numpad | ) |
Sets the numeric pad flag.
| numpad | the numeric pad flag value. |
Definition at line 148 of file key.cpp.
References mNumericPad.
Referenced by gcn::SDLInput::convertKeyCharacter().
| int gcn::Key::getValue | ( | ) | const |
Gets the value of the key. If an ascii value exists it will be returned. Otherwise an enum value will be returned.
Definition at line 158 of file key.cpp.
References mValue.
Referenced by gcn::FocusHandler::checkHotKey(), convertKey(), CButtonPanel::DoKey(), gcn::TextField::keyPress(), gcn::TextBox::keyPress(), gcn::Slider::keyPress(), gcn::RadioButton::keyPress(), gcn::ListBox::keyPress(), gcn::DropDown::keyPress(), gcn::CheckBox::keyPress(), gcn::Button::keyPress(), gcn::Button::keyRelease(), and gcn::Gui::logic().
| void gcn::Key::setValue | ( | int | value | ) |
Sets the value of the key. An ascii value or an enum value.
| value | the key value. |
Definition at line 153 of file key.cpp.
References mValue.
Referenced by gcn::SDLInput::convertKeyCharacter().
| std::string gcn::Key::toString | ( | ) | const |
Convert to a UTF8 string
Definition at line 163 of file key.cpp.
References mValue.
Referenced by InputKey(), gcn::TextField::keyPress(), and gcn::TextBox::keyPress().
int gcn::Key::mValue [protected] |
Definition at line 250 of file key.h.
Referenced by getValue(), isCharacter(), isLetter(), isNumber(), Key(), setValue(), and toString().
bool gcn::Key::mShiftPressed [protected] |
bool gcn::Key::mControlPressed [protected] |
Definition at line 252 of file key.h.
Referenced by isControlPressed(), Key(), and setControlPressed().
bool gcn::Key::mAltPressed [protected] |
bool gcn::Key::mMetaPressed [protected] |
bool gcn::Key::mNumericPad [protected] |
1.5.6