Skip to main content

CommandAction

Abstract base class for command actions (buttons, keys, etc.).

Command actions handle discrete input events like button presses from Logi devices. They execute a single action when triggered.

Example

class PlayPauseAction extends CommandAction {
name = "play-pause";
displayName = "Play/Pause";
description = "Toggle media playback";

onKeyDown() {
// Handle the button press
console.log("Play/Pause button pressed");
}
}

See

Extends

  • ManageAction

Constructors

Constructor

new CommandAction(): CommandAction;

Returns

CommandAction

Inherited from

ManageAction.constructor;

Methods

onKeyDown()

onKeyDown(): void | Promise<void>;

Handles the user pressing assigned key. Override this method to implement your command action behavior.

Returns

void | Promise<void>

Properties

description

abstract description: string;

Action Description shown in the UI.

Inherited from

ManageAction.description;

displayName

abstract displayName: string;

Display Name (or title) shown in the UI.

Inherited from

ManageAction.displayName;

groupName

readonly groupName: string = '';

Optional group/folder under which this action is listed in the UI. Leave empty to place the action at the top level.

Inherited from

ManageAction.groupName;

name

abstract readonly name: string;

Unique name for the action. Used for identification in the system.

Inherited from

ManageAction.name;