From 865a44adda0a3b32b39c0f20a85b45f5001f274b Mon Sep 17 00:00:00 2001
From: Ray <raysan5@gmail.com>
Date: Sun, 5 Jun 2022 11:34:23 +0200
Subject: [PATCH] REVIEWED: Mouse device support on `PLATFORM_DRM` #2381

---
 src/rcore.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/rcore.c b/src/rcore.c
index 85954e606..4acb6988c 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -6058,12 +6058,13 @@ static void ConfigureEvdevDevice(char *device)
     fd = open(device, O_RDONLY | O_NONBLOCK);
     if (fd < 0)
     {
-        TRACELOG(LOG_WARNING, "RPI: Failed to open input device %s", device);
+        TRACELOG(LOG_WARNING, "RPI: Failed to open input device: %s", device);
         return;
     }
     worker->fd = fd;
 
     // Grab number on the end of the devices name "event<N>"
+    // TODO: Grab number on the end of the device name "mouse<N>"
     int devNum = 0;
     char *ptrDevName = strrchr(device, 't');
     worker->eventNum = -1;
@@ -6072,6 +6073,7 @@ static void ConfigureEvdevDevice(char *device)
     {
         if (sscanf(ptrDevName, "t%d", &devNum) == 1) worker->eventNum = devNum;
     }
+    else worker->eventNum = 0;      // HACK for mouse0 device!
 
     // At this point we have a connection to the device, but we don't yet know what the device is.
     // It could be many things, even as simple as a power button...