Skip to content

Input macro commands don't support expression evaluation #2

@wizzomafizzo

Description

@wizzomafizzo

Problem

parseInputMacroArg (used by input.keyboard and input.gamepad commands) processes characters one at a time and has no SymExpressionStart handling. This means expressions like [[active_media.launcher_id]] are split into individual characters instead of being evaluated.

In contrast, parseArgs (used by all other commands) correctly handles SymExpressionStart at line 341 of arguments.go and delegates to parseExpression.

Expected behavior

**input.keyboard:[[active_media.launcher_id]] should evaluate the expression first, then pass the result through the input macro parser. For example, if active_media.launcher_id evaluates to "my-kodi", the macro parser should see my-kodi and process each character as a key press.

Suggested fix

Either:

  1. Add SymExpressionStart handling to parseInputMacroArg (like parseArgs does), or
  2. Pre-process expressions before the input macro parser runs

Option 1 is probably cleaner since it keeps expression handling consistent across all arg parsers.

Affected commands

  • input.keyboard
  • input.gamepad
  • Any future commands using isInputMacroCmd / parseInputMacroArg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions