Add Lua functions to query keyboard bindings and remove individual keybinds

Add core script file that defines possibility of rebinding keyboard commands to a different key
Enable the execution of global customization scripts
Make `scene_helper.lua` a script automatically included in the ScriptScheduler
This commit is contained in:
Alexander Bock
2017-12-08 14:58:18 -05:00
parent bce8e71d9b
commit c9aedb084b
24 changed files with 258 additions and 44 deletions

View File

@@ -40,6 +40,15 @@ namespace openspace::interaction {
class KeyBindingManager : public DocumentationGenerator {
public:
using IsLocalBind = ghoul::Boolean;
using IsSynchronized = ghoul::Boolean;
struct KeyInformation {
std::string command;
IsSynchronized synchronization;
std::string documentation;
};
KeyBindingManager();
~KeyBindingManager() = default;
@@ -59,19 +68,17 @@ public:
std::string documentation = ""
);
void removeKeyBinding(const std::string& key);
std::vector<std::pair<KeyWithModifier, KeyInformation>> keyBinding(
const std::string& key) const;
static scripting::LuaLibrary luaLibrary();
// Callback functions
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
private:
using Synchronized = ghoul::Boolean;
struct KeyInformation {
std::string command;
Synchronized synchronization;
std::string documentation;
};
std::string generateJson() const override;