瀏覽代碼

REVIEWED: Mouse device support on `PLATFORM_DRM` #2381

pull/2504/head
Ray 2 年之前
父節點
當前提交
865a44adda
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. +3
    -1
      src/rcore.c

+ 3
- 1
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...

Loading…
取消
儲存