From a43d1a58c820e019993265053399ca58d16cd1c3 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Sun, 21 May 2023 16:05:39 +0800 Subject: [PATCH] input: add vidpid as a clear text in unique mapping. --- input.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/input.cpp b/input.cpp index 7584323..b11d3aa 100644 --- a/input.cpp +++ b/input.cpp @@ -1444,7 +1444,7 @@ static char *get_map_name(int dev, int def) static char name[128]; char id[32]; - if (cfg.controller_unique_mapping) sprintfz(id, "%08x", input[dev].unique_hash); + if (cfg.controller_unique_mapping) sprintfz(id, "%s_%08x", input[dev].idstr, input[dev].unique_hash); else strcpyz(id, input[dev].idstr); if (def || is_menu()) sprintf(name, "input_%s%s_v3.map", id, input[dev].mod ? "_m" : ""); @@ -1456,7 +1456,7 @@ static char *get_kbdmap_name(int dev) { static char name[128]; - if (cfg.controller_unique_mapping) sprintfz(name, "kbd_%08x.map", input[dev].unique_hash); + if (cfg.controller_unique_mapping) sprintfz(name, "kbd_%s_%08x.map", input[dev].idstr, input[dev].unique_hash); else sprintfz(name, "kbd_%s.map", input[dev].idstr); return name; @@ -3396,10 +3396,8 @@ void mergedevs() strcpy(input[i].sysfs, sysfs); strcpy(input[i].mac, uniq); - int unique_hash = str_hash(input[i].id); - unique_hash = str_hash(input[i].mac, unique_hash); - unique_hash = str_hash(input[i].idstr, unique_hash); - input[i].unique_hash = unique_hash; + input[i].unique_hash = str_hash(input[i].id); + input[i].unique_hash = str_hash(input[i].mac, input[i].unique_hash); input[i].timeout = (strlen(uniq) && strstr(sysfs, "bluetooth")) ? (cfg.bt_auto_disconnect * 10) : 0; }