|
OpenGothic
Open source reimplementation of Gothic I and II
|
#include <keycodec.h>
Classes | |
| struct | ActionMapping |
| Encapsulates an in-game action and a key mapping that caused it to be fired. More... | |
Public Types | |
| enum class | Mapping { Primary , Secondary } |
| enum | Action : uint8_t { Idle , Escape , Inventory , Status , Log , Map , Heal , Potion , LookBack , FirstPerson , Forward , Back , Left , Right , RotateL , RotateR , Jump , ActionGeneric , ActionLeft , ActionRight , Parade , Walk , Sneak , Weapon , WeaponMele , WeaponBow , WeaponMage3 , WeaponMage4 , WeaponMage5 , WeaponMage6 , WeaponMage7 , WeaponMage8 , WeaponMage9 , WeaponMage10 , K_ENTER , K_F8 , K_K , K_O , K_Del , Last } |
Public Member Functions | |
| KeyCodec () | |
| Action | tr (Tempest::KeyEvent const &e) const |
| Action | tr (Tempest::MouseEvent const &e) const |
| Mapping | mapping (Tempest::KeyEvent const &e) const |
| Gets a mapping out of a key event. | |
| void | set (std::string_view section, std::string_view key, int32_t code) |
| void | clear (std::string_view section, std::string_view key) |
| void | setDefaultKeys (std::string_view preset) |
Static Public Member Functions | |
| static auto | keysStr (std::string_view keys) -> string_frm< 64 > |
| static int32_t | keyToCode (Tempest::Event::KeyType t) |
| static int32_t | keyToCode (Tempest::Event::MouseButton t) |
| static std::string | toCode (int32_t scan) |
Static Public Attributes | |
| static constexpr auto | NumMappings = 2 |
Definition at line 10 of file keycodec.h.
| enum KeyCodec::Action : uint8_t |
Definition at line 22 of file keycodec.h.
|
strong |
Up to two keyboard keys can be mapped to the same action. This enum determines the order of the mapping within a single key.
| Enumerator | |
|---|---|
| Primary | |
| Secondary | |
Definition at line 16 of file keycodec.h.
| KeyCodec::KeyCodec | ( | ) |
Definition at line 76 of file keycodec.cpp.
| void KeyCodec::clear | ( | std::string_view | section, |
| std::string_view | key | ||
| ) |
Definition at line 162 of file keycodec.cpp.
|
static |
Definition at line 305 of file keycodec.cpp.
|
static |
Definition at line 423 of file keycodec.cpp.
|
static |
Definition at line 430 of file keycodec.cpp.
| KeyCodec::Mapping KeyCodec::mapping | ( | Tempest::KeyEvent const & | e | ) | const |
Gets a mapping out of a key event.
| e | The key event. |
Definition at line 135 of file keycodec.cpp.
| void KeyCodec::set | ( | std::string_view | section, |
| std::string_view | key, | ||
| int32_t | code | ||
| ) |
Definition at line 139 of file keycodec.cpp.
| void KeyCodec::setDefaultKeys | ( | std::string_view | preset | ) |
Definition at line 166 of file keycodec.cpp.
|
static |
Definition at line 239 of file keycodec.cpp.
| KeyCodec::Action KeyCodec::tr | ( | Tempest::KeyEvent const & | e | ) | const |
Definition at line 107 of file keycodec.cpp.
| KeyCodec::Action KeyCodec::tr | ( | Tempest::MouseEvent const & | e | ) | const |
Definition at line 127 of file keycodec.cpp.
|
staticconstexpr |
Definition at line 20 of file keycodec.h.