Files
OpenSpace/data/assets/util/default_keybindings.asset
T
Alexander Bock 00f7e7dba0 First adjustment due to NCMNS suggestions
- Add Shift+A keybind for New Horizons scene to set the Aim+Anchor method, restoring the A keybind to the previous usage
 - Various fixes in the New Horizons scene to make it operable
 - Added optional keybinds CTRL+I, CTRL+K, CTRL+O, and CTRL+L for situations where the keypad is not available
 - Various fixes for the Rosetta scene
 - Updated the rosetta images to only download a single zip file that gets extracted
 - Rebound the Philae trail visibility from F to G so that it is not on the same key as the friction
 - Disable the Rosetta image plane on default
 - Added optional F12 keybind to create a screenshot if the PRINT_SCREEN button is not available
 - Automatically remove old delta time keybindings when new ones are set in order to prevent double-binding
2019-05-28 15:54:59 +02:00

150 lines
6.1 KiB
Plaintext

local sceneHelper = asset.require('./scene_helper')
local propertyHelper = asset.require('./property_helper')
local Keybindings = {
{
Key = "F1",
Name = "Show Native GUI",
Command = propertyHelper.invert('Modules.ImGUI.Main.Enabled'),
Documentation = "Shows or hides the native UI",
GuiPath = "/Native GUI",
Local = true
},
{
Key = "F4",
Name = "Show Performance Measurements",
Command = propertyHelper.invert("RenderEngine.PerformanceMeasurements"),
Documentation = "Toogles performance measurements that shows rendering time informations.",
GuiPath = "/Native GUI",
Local = true
},
{
Key = "ESC",
Name = "Toggle Shutdown",
Command = "openspace.toggleShutdown()",
Documentation = "Toggles the shutdown that will stop OpenSpace after a grace period. Press again to cancel the shutdown during this period.",
Local = true
},
{
Key = "PRINT_SCREEN",
Name = "Take Screenshot",
Command = "openspace.setPropertyValueSingle('RenderEngine.TakeScreenshot', nil)",
Documentation = "Saves the contents of the screen to a file in the working directory.",
GuiPath = "/Rendering",
Local = true
},
{
Key = "F12",
Name = "Take Screenshot",
Command = "openspace.setPropertyValueSingle('RenderEngine.TakeScreenshot', nil)",
Documentation = "Saves the contents of the screen to a file in the working directory.",
GuiPath = "/Rendering",
Local = true
},
{
Key = "SPACE",
Name = "Toggle Pause (Interpolated)",
Command = "openspace.time.interpolateTogglePause()",
Documentation = "Smoothly starts and stops the simulation time.",
GuiPath = "/Simulation Speed",
Local = true
},
{
Key = "Shift+SPACE",
Name = "Toggle Pause (Immediate)",
Command = "openspace.time.togglePause()",
Documentation = "Immediately starts and stops the simulation time.",
GuiPath = "/Simulation Speed",
Local = true
},
{
Key = "f",
Name = "Toggle Rotation friction",
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
Documentation = "Toggles the rotational friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely.",
GuiPath = "/Navigation",
Local = false
},
{
Key = "Shift+f",
Name = "Toggle Zoom Friction",
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
Documentation = "Toggles the zoom friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely.",
GuiPath = "/Navigation",
Local = false
},
{
Key = "Ctrl+f",
Name = "Toggle Roll Friction",
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
Documentation = "Toggles the roll friction of the camera. If it is disabled, the camera rolls around its own axis indefinitely.",
GuiPath = "/Navigation",
Local = false
},
{
Key = "w",
Name = "Fade to/from black",
Command = "if openspace.getPropertyValue('RenderEngine.BlackoutFactor') > 0.5 then openspace.setPropertyValueSingle('RenderEngine.BlackoutFactor', 0.0, 3) else openspace.setPropertyValueSingle('RenderEngine.BlackoutFactor', 1.0, 3) end",
Documentation = "Toggles the fade to black within 3 seconds or shows the rendering after 3 seconds.",
GuiPath = "/Rendering",
Local = false
},
{
Key = "Tab",
Name = "Toggle main GUI",
Command = propertyHelper.invert('Modules.CefWebGui.Visible'),
Documentation = "Toggles the main GUI",
GuiPath = "/GUI",
Local = true
},
{
Key = "Shift+Tab",
Name = "Toggle dashboard and overlays",
Command =
[[local isEnabled = openspace.getPropertyValue('Dashboard.IsEnabled');
openspace.setPropertyValueSingle('Dashboard.IsEnabled', not isEnabled);
openspace.setPropertyValueSingle("RenderEngine.ShowLog", not isEnabled);
openspace.setPropertyValueSingle("RenderEngine.ShowVersion", not isEnabled);
openspace.setPropertyValueSingle("RenderEngine.ShowCamera", not isEnabled)]],
Documentation = "Toggles the dashboard and overlays",
GuiPath = "/GUI",
Local = true
},
{
Key = "Alt+R",
Name = "Toggle rendering on master",
Command = propertyHelper.invert('RenderEngine.DisableMasterRendering'),
Documentation = "Toggles the rendering on master",
GuiPath = "/Rendering",
Local = true
}
}
local DeltaTimeKeys
asset.onInitialize(function()
sceneHelper.bindKeys(Keybindings)
DeltaTimeKeys = sceneHelper.setDeltaTimeKeys({
-- 1 2 3 4 5 6 7 8 9 0
--------------------------------------------------------------------------------------------------------------------------
-- 1s 2s 5s 10s 30s 1m 2m 5m 10m 30m
1, 2, 5, 10, 30, 60, 120, 300, 600, 1800,
-- 1h 2h 3h 6h 12h 1d 2d 4d 1w 2w
3600, 7200, 10800, 21600, 43200, 86400, 172800, 345600, 604800, 1209600,
-- 1mo 2mo 3mo 6mo 1yr 2y 5y 10y 20y 50y
2592000, 5184000, 7776000, 15552000, 31536000, 63072000, 157680000, 315360000, 630720000, 1576800000
})
-- OBS: One month (1mo) is approximated by 30 days.
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
sceneHelper.unbindKeys(DeltaTimeKeys)
end)
asset.export("DefaultKeybindings", Keybindings)
asset.export("DefaultDeltaTimeKeys", DeltaTimeKeys)