From 82d06b00277ce4ed2a6bc913fd44eb8fddb785f4 Mon Sep 17 00:00:00 2001 From: hinsbart Date: Mon, 29 Feb 2016 16:48:19 +0100 Subject: [PATCH] use joystick name from mapping-db if available --- main/input_default.cpp | 2 ++ main/input_default.h | 1 + 2 files changed, 3 insertions(+) diff --git a/main/input_default.cpp b/main/input_default.cpp index 734fdf5afaf..226656d8f45 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -173,6 +173,7 @@ void InputDefault::joy_connection_changed(int p_idx, bool p_connected, String p_ for (int i=0; i < map_db.size(); i++) { if (js.uid == map_db[i].uid) { mapping = i; + js.name = map_db[i].name; //printf("found mapping\n"); }; }; @@ -826,6 +827,7 @@ void InputDefault::parse_mapping(String p_mapping) { uid.resize(17); mapping.uid = entry[0]; + mapping.name = entry[1]; int idx = 1; while (++idx < entry.size()) { diff --git a/main/input_default.h b/main/input_default.h index 2f98d279d6c..471ae9e692b 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -102,6 +102,7 @@ private: struct JoyDeviceMapping { String uid; + String name; Map buttons; Map axis; JoyEvent hat[HAT_MAX];