83 Action tr(Tempest::KeyEvent
const& e)
const;
84 Action tr(Tempest::MouseEvent
const& e)
const;
91 void set(std::string_view section, std::string_view key, int32_t code);
92 void clear(std::string_view section, std::string_view key);
95 static int32_t
keyToCode(Tempest::Event::KeyType t);
96 static int32_t
keyToCode(Tempest::Event::MouseButton t);
98 static std::string
toCode(int32_t scan);
102 K_Key(Tempest::Event::KeyType k, int32_t code):k(k),code(code){}
103 Tempest::Event::KeyType k=Tempest::Event::K_NoKey;
107 M_Key(Tempest::Event::MouseButton k, int32_t code):k(k),code(code){}
108 Tempest::Event::MouseButton k=Tempest::Event::ButtonNone;
113 const char* key =
"";
115 bool is(int32_t i)
const {
return k[0]==i || k[1]==i; }
120 auto mapping(int32_t i)
const -> std::optional<Mapping> {
129 auto implTr(int32_t code)
const -> ActionMapping;
130 static int fetch(std::string_view keys,
size_t s,
size_t e);
132 static auto keyToStr(Tempest::Event::KeyType k) ->
string_frm<64>;
133 static auto keyToStr(Tempest::Event::MouseButton k) ->
string_frm<64>;
135 void setDefaultKeysG1();
136 void setDefaultKeysG1Alt();
137 void setupSettings();
138 KeyPair setup(
const char* kp);
139 static auto parse(std::string_view kp) -> KeyPair;
144 KeyPair keyLockTarget;
146 KeyPair keyActionRight;
147 KeyPair keyActionLeft;
152 KeyPair keyStrafeLeft;
153 KeyPair keyStrafeRight;
161 KeyPair keyInventory;
162 KeyPair keyShowStatus;
166 std::vector<KeyPair*> allKeys;
168 static std::initializer_list<K_Key> keys;
169 static std::initializer_list<M_Key> mkeys;