diff --git a/Controllers/WootingKeyboardController/WootingTwoKeyboardController/WootingTwoKeyboardController.cpp b/Controllers/WootingKeyboardController/WootingTwoKeyboardController/WootingTwoKeyboardController.cpp index 37c32e2d..b1a78dff 100644 --- a/Controllers/WootingKeyboardController/WootingTwoKeyboardController/WootingTwoKeyboardController.cpp +++ b/Controllers/WootingKeyboardController/WootingTwoKeyboardController/WootingTwoKeyboardController.cpp @@ -10,6 +10,7 @@ \*---------------------------------------------------------*/ #include +#include "StringUtils.h" #include "WootingTwoKeyboardController.h" #define WOOTING_TWO_REPORT_SIZE 257 @@ -37,21 +38,22 @@ static unsigned int matrix_to_led_index_map_full[WOOTING_RGB_ROWS * WOOTING_TWO_ WootingTwoKeyboardController::WootingTwoKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type) { - const int szTemp = 256; - wchar_t tmpName[szTemp]; - dev = dev_handle; location = path; this->wooting_type = wooting_type; key_code_limit = (wooting_type == WOOTING_KB_TKL) ? WOOTING_ONE_KEY_CODE_LIMIT : WOOTING_TWO_KEY_CODE_LIMIT; + /*---------------------------------------------------------*\ + | Get device HID manufacturer and product strings | + \*---------------------------------------------------------*/ + const int szTemp = 256; + wchar_t tmpName[szTemp]; + hid_get_manufacturer_string(dev, tmpName, szTemp); - std::wstring wName = std::wstring(tmpName); - vendor = std::string(wName.begin(), wName.end()); + vendor = std::string(StringUtils::wstring_to_string(tmpName)); hid_get_product_string(dev, tmpName, szTemp); - wName = std::wstring(tmpName); - description = std::string(wName.begin(), wName.end()); + description = std::string(StringUtils::wstring_to_string(tmpName)); SendInitialize(); }