Skip to main content

Plugin Class

Base class for plugins.

public abstract class Plugin : System.IDisposable

Inheritance System.Object → Plugin

Implements System.IDisposable

Remarks​

Inherit this class to create a plugin. Override Load() and Unload() for initialization and cleanup. Set HasNoApplication to define whether this is an Application or Universal plugin.

Properties​

Plugin.ClientApplication Property​

Gets the target application instance that this plugin controls.

public Loupedeck.ClientApplication ClientApplication { get; }

Property Value​

ClientApplication

Remarks​

Use this property to interact with application-specific functionality such as sending keyboard shortcuts, checking application state, or accessing application-specific APIs.

Plugin.HasNoApplication Property​

Gets a value indicating whether this is a Universal plugin or an Application plugin.

public virtual bool HasNoApplication { get; }

Property Value​

System.Boolean

Remarks​

Override this property to return true for Universal plugins that provide general-purpose functionality and don't require a specific application to be in the foreground. Return false (default) for Application plugins that integrate with a specific application and require it to be active.

Plugin.Info Property​

Gets the plugin metadata displayed in the host application.

public Loupedeck.PluginInfo Info { get; }

Property Value​

Loupedeck.PluginInfo

Remarks​

Contains information such as display name, description, author, version, homepage, and icons. This information is shown to users in the plugin management interface.

Plugin.Log Property​

Gets the logging interface for writing diagnostic messages and errors.

public Loupedeck.PluginLogFile Log { get; }

Property Value​

Loupedeck.PluginLogFile

Plugin.Name Property​

Gets the unique identifier for this plugin.

public string Name { get; protected set; }

Property Value​

System.String

Remarks​

The plugin name is derived from the class name with "Plugin" suffix removed. This name is used to identify the plugin throughout the system.

Plugin.SupportedDevices Property​

Gets or sets the device types supported by this plugin.

public Loupedeck.DeviceType SupportedDevices { get; set; }

Property Value​

DeviceType

Remarks​

Use this property to restrict which devices can use this plugin. Set to All to support all devices, or combine specific device types using bitwise OR.

Plugin.UsesApplicationApiOnly Property​

Gets a value indicating whether this plugin uses only application-specific APIs rather than keyboard shortcuts.

public virtual bool UsesApplicationApiOnly { get; }

Property Value​

System.Boolean

Remarks​

Override this property to return true if your plugin controls the target application exclusively through its API and does not send keyboard shortcuts. This allows the plugin to function even when the application is not in the foreground. Return false (default) if your plugin sends keyboard shortcuts, which require the application to be active.

Methods​

Plugin.AddMode(PluginMode) Method​

Adds a mode to the plugin's mode collection.

public void AddMode(Loupedeck.PluginMode mode);

Parameters​

mode Loupedeck.PluginMode

The mode instance to register with the plugin.

Remarks​

Use this method to dynamically add modes at runtime. The mode name must be unique within the plugin.

Plugin.CanLoad() Method​

Determines whether the plugin can be loaded.

public virtual bool CanLoad();

Returns​

System.Boolean
true if the plugin can be loaded; otherwise, false.

Remarks​

Override this method to prevent plugin loading under specific conditions.

Plugin.GetMode(string) Method​

Retrieves a mode by name.

public Loupedeck.PluginMode GetMode(string modeName);

Parameters​

modeName System.String

The name of the mode to retrieve.

Returns​

Loupedeck.PluginMode
The mode with the specified name, or null if not found.

Plugin.GetPluginDataDirectory() Method​

Gets the directory path for plugin-specific data storage.

public string GetPluginDataDirectory();

Returns​

System.String
The absolute path to the plugin's data directory.

Remarks​

Use this directory to store plugin data files that need to persist between sessions. The directory is created automatically if it does not exist.

Plugin.GetSubMode(string, string) Method​

Retrieves a submode by parent mode name and submode name.

public Loupedeck.PluginMode GetSubMode(string modeName, string subModeName);

Parameters​

modeName System.String

The name of the parent mode.

subModeName System.String

The name of the submode to retrieve.

Returns​

Loupedeck.PluginMode
The submode with the specified name, or null if not found.

Plugin.Install() Method​

Called to perform plugin-specific installation setup.

public virtual bool Install();

Returns​

System.Boolean
true if installation succeeded; otherwise, false.

Remarks​

Override this method to perform custom installation tasks beyond the default installation handled by the Logi Plugin Service. This method runs with normal user permissions.

Plugin.InstallAdmin() Method​

Called during plugin installation for tasks that require administrator permissions.

public virtual bool InstallAdmin();

Returns​

System.Boolean
true if installation succeeded; otherwise, false.

Remarks​

Override this method to include installation tasks that require administrator permissions. Standard installation tasks should be performed in Install() instead.

Plugin.IsApplicationActive() Method​

Checks whether the target application is currently active (has foreground focus).

public bool IsApplicationActive();

Returns​

System.Boolean
true if the application is in the foreground; otherwise, false.

Plugin.IsApplicationInstalled() Method​

Checks whether the target application is installed on the system.

public bool IsApplicationInstalled();

Returns​

System.Boolean
true if the application is installed; otherwise, false.

Plugin.IsApplicationRunning() Method​

Checks whether the target application is currently running.

public bool IsApplicationRunning();

Returns​

System.Boolean
true if the application process is running; otherwise, false.

Plugin.Load() Method​

Called when the Logi Plugin Service loads the plugin.

public virtual void Load();

Remarks​

Override this method to perform plugin initialization such as registering event handlers, starting background tasks, or connecting to external services.

Plugin.RemoveMode(PluginMode) Method​

Removes a mode from the plugin's mode collection.

public void RemoveMode(Loupedeck.PluginMode mode);

Parameters​

mode Loupedeck.PluginMode

The mode instance to unregister from the plugin.

Plugin.SetCurrentMode(string) Method​

Called when the Logi Plugin Service requests a mode change.

public virtual bool SetCurrentMode(string modeName);

Parameters​

modeName System.String

The name of the mode to activate.

Returns​

System.Boolean
true if the mode change was handled successfully; otherwise, false.

Remarks​

Override this method if your plugin can programmatically change the target application's mode or state. Return true if the mode change was applied, or false if the plugin does not support programmatic mode changes.

Plugin.Uninstall() Method​

Called to perform plugin-specific uninstallation cleanup.

public virtual bool Uninstall();

Returns​

System.Boolean
true if uninstallation succeeded; otherwise, false.

Remarks​

Override this method to perform custom cleanup tasks beyond the default uninstallation handled by the Logi Plugin Service. This method runs with normal user permissions.

Plugin.UninstallAdmin() Method​

Called during plugin uninstallation for tasks that require administrator permissions.

public virtual bool UninstallAdmin();

Returns​

System.Boolean
true if uninstallation succeeded; otherwise, false.

Remarks​

Override this method to include uninstallation tasks that require administrator permissions. Standard uninstallation tasks should be performed in Uninstall() instead.

Plugin.Unload() Method​

Called when the Logi Plugin Service unloads the plugin.

public virtual void Unload();

Remarks​

Override this method to perform cleanup such as unregistering event handlers, stopping background tasks, or disconnecting from external services.

Events​

Plugin.ModeChanged Event​

Occurs when the plugin's current mode or submode changes.

public event EventHandler<PluginModeChangedEventArgs> ModeChanged;

Event Type​

System.EventHandler<Loupedeck.PluginModeChangedEventArgs>

Remarks​

Subscribe to this event to be notified when users switch between modes or submodes. The event provides the new mode and submode in the event arguments.