Skip to content

[rcore][drm] Adding support for more than one keyboard/mouse #4631

Open
@jwaxy

Description

@jwaxy

Please, before submitting a new issue verify and check:

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

First of all, thank you for creating and maintaining raylib—it's an amazing library that makes graphics programming fun and accessible!

While working on a project using raylib with the DRM backend (PLATFORM=DRM), I noticed that the DRM backend currently supports:

  • Only 1 mouse
  • Only 1 keyboard
  • A limited, configurable number of gamepads (default: 4).

To address this, I myself implemented dynamic support for multiple mouse and keyboard devices in a custom Raylib source. My approach involved:

  • Making mouseFd and keyboardFd pointers to dynamically allocated arrays.
  • Using RL_REALLOC to adjust the array size as new devices are configured.

I would like to clarify if the current limitation on device counts is intentional or simply a design decision. Additionally, I’m considering creating a pull request for this enhancement and would like feedback on whether it would be desirable. Specifically:

  • Should I implement this dynamic support for all devices (mouse, keyboard, gamepads)?
  • Or should I implement fixed, configurable amount for mouse and keyboard like gamepads are implemented
  • Are there specific concerns or guidelines I should be aware of?

Environment

Operating System: Arch Linux
Platform Backend: DRM
Other details are likely not relevant to this issue but can be provided if necessary.

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

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions