Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function isKeyAllowedInContext

    • Decide whether a key binding is allowed in a context based on its filter config.

      Rules (matching the existing context manager behavior):

      • If blockedKeys contains the canonical binding key, the binding is rejected.
      • If allowedKeys contains neither the base key nor canonical binding key, the binding is rejected.
      • Otherwise the key is allowed.

      blockedKeys always wins over allowedKeys when both are present and both list the key (defense in depth).

      Bare blocked keys do not reject modified bindings on the same key. This lets a context block bare ArrowUp for fly-control passthrough while still owning Shift+ArrowUp. Bare allowlist entries continue to admit every modifier variant so fly-control bindings such as Shift+W remain reachable.

      Parameters

      • key: string

        The base key to test (usually event.key).

      • config: KeyFilterConfig

        The filter config.

      • bindingKey: string = ...

        Canonical modifier-aware binding key. Defaults to the normalized base key for callers that do not use modifiers.

      Returns boolean

      true if the key is allowed.