Merge branch 'main' into voice

This commit is contained in:
Kae 2023-07-12 20:59:52 +10:00
commit cf09616b1b

View File

@ -8,18 +8,18 @@
namespace Star {
STAR_CLASS(Input);
STAR_EXCEPTION(InputException, StarException);
STAR_CLASS(Input);
STAR_EXCEPTION(InputException, StarException);
typedef Variant<Key, MouseButton, ControllerButton> InputVariant;
typedef Variant<Key, MouseButton, ControllerButton> InputVariant;
template <>
struct hash<InputVariant> {
template <>
struct hash<InputVariant> {
size_t operator()(InputVariant const& v) const;
};
};
class Input {
public:
class Input {
public:
static Json inputEventToJson(InputEvent const& event);
@ -117,11 +117,11 @@ namespace Star {
inline void release() { released = ++releases; held = false; }
};
// Get pointer to the singleton root instance, if it exists. Otherwise,
// Get pointer to the singleton Input instance, if it exists. Otherwise,
// returns nullptr.
static Input* singletonPtr();
// Gets reference to GuiContext singleton, throws GuiContextException if root
// Gets reference to Input singleton, throws InputException if root
// is not initialized.
static Input& singleton();
@ -156,7 +156,7 @@ namespace Star {
void setBinds(String const& categoryId, String const& bindId, Json const& binds);
Json getDefaultBinds(String const& categoryId, String const& bindId);
Json getBinds(String const& categoryId, String const& bindId);
private:
private:
List<BindEntry*> filterBindEntries(List<BindRef> const& binds, KeyMod mods) const;
BindEntry* bindEntryPtr(String const& categoryId, String const& bindId);
@ -185,7 +185,8 @@ namespace Star {
KeyMod m_pressedMods;
bool m_textInputActive;
};
};
}
#endif