Available Triggers

HotKeyTrigger

class voice_commander.triggers.HotkeyTrigger(hotkey)[source]

Uses AutoHotkey hotkeys to trigger actions.

Availability: Windows

__init__(hotkey)[source]
Parameters:

hotkey (str) – the trigger hotkey – same syntax as AutoHotkey hotkeys

JoystickButtonTrigger

Tip

Use python -m voice_commander joy-button-info to get joystick index and button numbers

class voice_commander.triggers.JoystickButtonTrigger(joystick_index, joystick_button)[source]

Like voice_commander.triggers.HotkeyTrigger but with a convenient constructor for defining joystick button hotkeys.

Availability: Windows

__init__(joystick_index, joystick_button)[source]
Parameters:
  • joystick_index (int | str) – the index of the joystick device (per AutoHotkey indices)

  • joystick_button (str) – the button number (between 1 and 32)

Note: if you want to trigger on a POV hat, use voice_commander.triggers.JoystickAxisTrigger instead.

JoystickAxisTrigger

Tip

Use python -m voice_commander joy-axis-info to get joystick index and axis information

class voice_commander.triggers.JoystickAxisTrigger(axis_name, trigger_mode, trigger_value, joystick_index, polling_frequency=30)[source]

Uses AutoHotkey to monitor joystick axis values and trigger according to specified parameters

Availability: Windows

__init__(axis_name, trigger_mode, trigger_value, joystick_index, polling_frequency=30)[source]
Parameters:
  • axis_name (str) – The name of the axis to monitor: X, Y, Z, R, U, V, or POV

  • trigger_mode (AxisTriggerMode | int) – one of AxisTriggerMode - controls the logic of trigger gates

  • trigger_value (int | float | tuple[int | float, int | float]) – the axis value trigger threshold(s). When using VALUE_BETWEEN mode, use a tuple to specify the lower and upper threshold bounds.

  • joystick_index (int) – the index of the joystick to monitor

  • polling_frequency (int) – how frequently to check axis value (the higher this value is, the lower the delay between checks)

VoiceTrigger

class voice_commander.triggers.VoiceTrigger(*trigger_phrases)[source]

Trigger on spoken voice commands. You can add multiple trigger phrases at once.

__init__(*trigger_phrases)[source]