浏览代码

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); fd = open(device, O_RDONLY | O_NONBLOCK);
if (fd < 0) 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; return;
} }
worker->fd = fd; worker->fd = fd;
// Grab number on the end of the devices name "event<N>" // 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; int devNum = 0;
char *ptrDevName = strrchr(device, 't'); char *ptrDevName = strrchr(device, 't');
worker->eventNum = -1; worker->eventNum = -1;
@ -6072,6 +6073,7 @@ static void ConfigureEvdevDevice(char *device)
{ {
if (sscanf(ptrDevName, "t%d", &devNum) == 1) worker->eventNum = devNum; 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. // 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... // It could be many things, even as simple as a power button...

正在加载...
取消
保存