Merge branch 'master' of https://git.epicsparrow.com/EpicSparrow/SparrowInput
This commit is contained in:
commit
c543e253c6
@ -200,7 +200,16 @@ std::vector<Action> Input::getActions()
|
||||
}
|
||||
|
||||
/* context-related functions */
|
||||
void Input::updateKeyBindings(){
|
||||
std::vector<std::string> Input::getContextsList()
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
for(auto context : m_contexts)
|
||||
res.push_back(context.getName());
|
||||
return res;
|
||||
}
|
||||
|
||||
void Input::updateKeyBindings()
|
||||
{
|
||||
m_keybindings.clear();
|
||||
for (auto iter= m_contexts.begin(); iter != m_contexts.end(); ++iter)
|
||||
m_keybindings[iter->getName()]= KeyBindings(*iter,m_keysmap);
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
|
||||
/* general action-mapping functions */
|
||||
void setKeysMap(IKeysMap km); //set bindings
|
||||
IKeysMap getKeysMap(){return m_keysmap;}
|
||||
void updateEvents(); //handle the input and put the associated event in the file
|
||||
std::vector<Action> getActions(); //get the first action in the file of event
|
||||
|
||||
@ -62,6 +63,7 @@ public:
|
||||
void addContext(Context context){m_contexts.push_back(context); updateKeyBindings();}
|
||||
std::string getCurrentContext(){return m_current_context;}
|
||||
void setCurrentContext(std::string context_name){m_current_context = context_name;}
|
||||
std::vector<std::string> getContextsList();
|
||||
void updateKeyBindings();
|
||||
|
||||
/* window-related function */
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
enum {PRESSED, RELEASED, HOLD};
|
||||
IKeysMap();
|
||||
std::vector<Binding> getBindings(Action action) const;
|
||||
std::vector<Binding>& data(){return keys;}
|
||||
protected:
|
||||
std::vector<Binding> keys;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user