Skip to content

Support multiple active controllers + full button/analog mapping #1214

Description

@markwpearce

Follow-up to #203, from a discussion with @lvcabral.

Description

  • Currently one analog stick (axes 0/1) is mapped, and only to d-pad directions - no right stick, no L1/L2/R1/R2, no X/Y face buttons, no analog trigger values
  • Each connected pad gets a distinct remote id (getRemoteID()), but there's no per-controller button mapping, and all pads share the same 5-slot key ring buffer - simultaneous input from >1 pad can clobber each other's queued events, which matters once we're actually treating each pad as its own player
  • roUniversalControlEvent has no analog fields (matching the real Roku API), so analog data needs a different exposure than overloading getKey()'s existing key vocabulary

Proposal

  1. Support more than one active controller at the same time (eg. for multiplayer games)
  2. Support analog sticks and all typical controller buttons (A/B/X/Y, DPad, L1/L2/R1/R2, dual analog sticks, etc)
  3. Gate all of this behind a manifest flag, similar to multi_key_events - off by default, no behavior change for existing apps
  4. Should be exposed via roUniversalControlEvent (or similar) so apps consume it the same way as any other remote input
    • Add getValue(...) as float returning [-1, 1] for analog axes
    • Keep it back compatible for discrete buttons/DPad by just returning 0 or 1 there

Happy to help test once I get a controller that pairs with my laptop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions