donniebreve / touchcursor-linux

TouchCursor style keyboard remapping for Linux.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Won't find Keyboard if it has a : in the name

robinxan opened this issue · comments

Hi,
touchcursor won't find my Keyboard.

I: Bus=0003 Vendor=1b1c Product=1b11 Version=0308
N: Name="ckb1: Corsair K95 RGB Gaming Keyboard vKB"
P: Phys=
S: Sysfs=/devices/virtual/input/input35
U: Uniq=
H: Handlers=sysrq kbd event20 rfkill leds 
B: PROP=0
B: EV=120003

If i comment out the following it works fine.

diff --git a/src/config.c b/src/config.c
index a7487ef..27fb369 100644
--- a/src/config.c
+++ b/src/config.c
@@ -54,14 +54,14 @@ void findDeviceEvent(char* deviceConfigValue)
 
     char* deviceName = deviceConfigValue;
     int deviceNumber = 1;
-    if (strstr(deviceConfigValue, ":"))
-    {
-        char* tokens = deviceConfigValue;
-        char* token = strsep(&tokens, ":");
-        deviceName = token;
-        token = strsep(&tokens, ":");
-        deviceNumber = atoi(token);
-    }
+    // if (strstr(deviceConfigValue, ":"))
+    // {
+    //     char* tokens = deviceConfigValue;
+    //     char* token = strsep(&tokens, ":");
+    //     deviceName = token;
+    //     token = strsep(&tokens, ":");
+    //     deviceNumber = atoi(token);
+    // }
 
     char* devicesFilePath = "/proc/bus/input/devices";
     FILE* devicesFile = fopen(devicesFilePath, "r");

Probably needs some form of escaping or another symbol for skipping devices.

This should be fixed. If you are able, please pull down the latest version and confirm. Thanks!

Yes works out of the box now.
Thanks!