Skip to content

Commit

Permalink
Ignore Wii U pro controller
Browse files Browse the repository at this point in the history
  • Loading branch information
capitalistspz authored and Exzap committed Jan 19, 2024
1 parent 72aacbd commit 18679af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/input/api/Wiimote/hidapi/HidapiWiimote.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "HidapiWiimote.h"
#include <cwchar>

static constexpr uint16 WIIMOTE_VENDOR_ID = 0x057e;
static constexpr uint16 WIIMOTE_PRODUCT_ID = 0x0306;
static constexpr uint16 WIIMOTE_MP_PRODUCT_ID = 0x0330;
static constexpr uint16 WIIMOTE_MAX_INPUT_REPORT_LENGTH = 22;
static constexpr auto PRO_CONTROLLER_NAME = L"Nintendo RVL-CNT-01-UC";

HidapiWiimote::HidapiWiimote(hid_device* dev, std::string_view path)
: m_handle(dev), m_path(path) {
Expand All @@ -30,6 +32,8 @@ std::vector<WiimoteDevicePtr> HidapiWiimote::get_devices() {
for (auto it = device_enumeration; it != nullptr; it = it->next){
if (it->product_id != WIIMOTE_PRODUCT_ID && it->product_id != WIIMOTE_MP_PRODUCT_ID)
continue;
if (std::wcscmp(it->product_string, PRO_CONTROLLER_NAME) == 0)
continue;
auto dev = hid_open_path(it->path);
if (!dev){
cemuLog_logDebug(LogType::Force, "Unable to open Wiimote device at {}: {}", it->path, boost::nowide::narrow(hid_error(nullptr)));
Expand Down

0 comments on commit 18679af

Please sign in to comment.