| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Requires Virt-A-Mate 1.20.77.2 or more recent!
Keybindings.cslist is the main plugin, and should be installed as a session plugin. This is what controls the keyboard shortcuts and provides the "shared commands", e.g. adding atoms and opening panels.
Bindings with an asterisk (*) can be bound to joysticks and mouse. You can use modifier keys too, for example you can use Alt + Mouse X by holding the Alt key and moving the mouse to the left or to the right.
CustomCommands.cslist can be used to create commands in your scene that you can bind. For example, you could bind F5 to "Play_Animation", and if your scene contains an atom with this command, it will be executed. If more than one atom has this command, the current or the last atom containing this command will be executed.
This plugin is still being actively developed! Here are some gotchas:
You can publish your own commands to be used by Keybindings. It will use the vam-plugins-interop-specs specifications.
In short, you simply need to call OnActionsProviderAvailable when your plugin is ready to receive shortcuts, and implement OnBindingsListRequested to add the JSONStorableAction you want to make available.
public class YourPlugin : MVRScript
{
public void Init()
{
// Call this when ready to receive shortcuts or when shortcuts have changed
SuperController.singleton.BroadcastMessage("OnActionsProviderAvailable", this, SendMessageOptions.DontRequireReceiver);
}
public void OnDestroy()
{
// Call this when this plugin should not receive shortcuts anymore
SuperController.singleton.BroadcastMessage("OnActionsProviderDestroyed", this, SendMessageOptions.DontRequireReceiver);
}
// This method will be called by Keybindings when it is ready.
public void OnBindingsListRequested(List<object> bindings)
{
bindings.Add(new JSONStorableAction("SayHi", () => SuperController.LogMessage("Hi!")));
}
}You can also optionally provide additional settings to Keybindings by returning an IEnumerable<string, string> in the OnBindingListRequested method:
public void OnBindingsListRequested(List<object> bindings)
{
bindings.Add(new Dictionary<string, string>
{
// This will determine the "prefix" for your commands, e.g. MySuperPlugin.SayHi
{ "Namespace", "MySuperPlugin" }
});
bindings.Add(new JSONStorableAction("SayHi", () => SuperController.LogMessage("Hi!")));
}Supported storables:
It is possible to invoke a Keybindings. Please only use this for commands initiated by the user with the intent of invoking those bindings. For example, do NOT use this in a scene.
SuperController.singleton.BroadcastMessage("InvokeKeybindingsAction", "Namespace.CommandName", SendMessageOptions.DontRequireReceiver);| Back | FazBrowse Home | New Git URL |