mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-01 09:10:18 -06:00
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
21 lines
569 B
Lua
21 lines
569 B
Lua
openspace.documentation = {
|
|
{
|
|
Name = "rebindKey",
|
|
Arguments = "string, string",
|
|
Documentation = "Rebinds all scripts from the old key (first argument) to the " ..
|
|
"new key (second argument)."
|
|
}
|
|
}
|
|
|
|
openspace.rebindKey = function(old_key, new_key)
|
|
local t = openspace.getKeyBinding(old_key)
|
|
openspace.clearKey(old_key)
|
|
for _, v in pairs(t) do
|
|
if v["Remote"] then
|
|
openspace.bindKey(new_key, v["Command"])
|
|
else
|
|
openspace.bindKeyLocal(new_key, v["Command"])
|
|
end
|
|
end
|
|
end
|