张洋 1 săptămână în urmă
părinte
comite
2c8d71c548

+ 0 - 97
zhipuzi_pos_windows/helper/CSystem.cpp

@@ -609,93 +609,6 @@ void CSystem::HideSystemKeyboard()
 	}
 }
 
-// 递归遍历PNP树,查找是否存在BTH\开头的蓝牙硬件子设备
-static bool HasBluetoothChildDevice(HDEVINFO hDevInfo, SP_DEVINFO_DATA* parentDevInfo)
-{
-	WCHAR parentInstanceId[4096]{};
-	if (!SetupDiGetDeviceInstanceIdW(hDevInfo, parentDevInfo, parentInstanceId, _countof(parentInstanceId), nullptr))
-		return false;
-
-	SP_DEVINFO_DATA childInfo{};
-	childInfo.cbSize = sizeof(SP_DEVINFO_DATA);
-
-	for (DWORD i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &childInfo); i++)
-	{
-		WCHAR childParentId[4096]{};
-		DWORD propType = 0;
-		// SPDRP_PARENT_DEVICE_ID 0x19
-		if (!SetupDiGetDeviceRegistryPropertyW(hDevInfo, &childInfo, SPDRP_PARENT_DEVICE_ID,
-			&propType, (PBYTE)childParentId, sizeof(childParentId), nullptr))
-			continue;
-
-		if (_wcsicmp(childParentId, parentInstanceId) != 0)
-			continue;
-
-		WCHAR hwIds[4096]{};
-		if (SetupDiGetDeviceRegistryPropertyW(hDevInfo, &childInfo, SPDRP_HARDWAREID,
-			&propType, (PBYTE)hwIds, sizeof(hwIds), nullptr))
-		{
-			std::wstring hwStr(hwIds);
-			if (hwStr.find(L"BTH\\") != std::wstring::npos)
-			{
-				return true;
-			}
-		}
-		if (HasBluetoothChildDevice(hDevInfo, &childInfo))
-		{
-			return true;
-		}
-	}
-	return false;
-}
-
-// 根据RawInput hDevice 判断设备是否挂在虚拟总线上(Oray VHID / VHF)
-static bool IsRawInputDeviceOnVirtualBus(HANDLE hRawDevice)
-{
-	UINT bufLen = 0;
-	GetRawInputDeviceInfoW(hRawDevice, RIDI_DEVICENAME, nullptr, &bufLen);
-	if (bufLen == 0) return false;
-
-	std::wstring devName(bufLen, L'\0');
-	bufLen = (UINT)devName.size();
-	UINT ret = GetRawInputDeviceInfoW(hRawDevice, RIDI_DEVICENAME, devName.data(), &bufLen);
-	if (ret == (UINT)-1) return false;
-
-	HDEVINFO hDevInfo = SetupDiGetClassDevsW(NULL, NULL, NULL, DIGCF_PRESENT | DIGCF_ALLCLASSES);
-	if (hDevInfo == INVALID_HANDLE_VALUE)
-		return false;
-
-	SP_DEVINFO_DATA devInfoData{};
-	devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
-	bool isVirtual = false;
-
-	for (DWORD i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &devInfoData); i++)
-	{
-		WCHAR szInstanceId[4096]{};
-		if (!SetupDiGetDeviceInstanceIdW(hDevInfo, &devInfoData, szInstanceId, _countof(szInstanceId), nullptr))
-			continue;
-
-		if (wcsstr(devName.c_str(), szInstanceId) != nullptr)
-		{
-			WCHAR szLocation[1024]{};
-			DWORD propType = 0;
-			if (SetupDiGetDeviceRegistryPropertyW(hDevInfo, &devInfoData, SPDRP_LOCATION_INFORMATION,
-				&propType, (PBYTE)szLocation, sizeof(szLocation), nullptr))
-			{
-				std::wstring locStr(szLocation);
-				if (locStr.find(L"Oray VHID") != std::wstring::npos
-					|| locStr.find(L"VHF") != std::wstring::npos)
-				{
-					isVirtual = true;
-				}
-			}
-			break;
-		}
-	}
-	SetupDiDestroyDeviceInfoList(hDevInfo);
-	return isVirtual;
-}
-
 // 核心判断:是否为真实物理键盘
 bool IsRealPhysicalKeyboard(LPCWSTR szDevicePath, std::wstring* pDebugOut)
 {
@@ -935,16 +848,6 @@ void CSystem::ShowKeyboardDeviceNames()
 				hasRealKeyboard = true;
 			}
 
-			// 打印是否虚拟总线(保留原有逻辑)
-			if (IsRawInputDeviceOnVirtualBus(devices[i].hDevice))
-			{
-				oss << L"  BusCheck: [Virtual Bus Detected!]\r\n";
-			}
-			else
-			{
-				oss << L"  BusCheck: [Physical Bus]\r\n";
-			}
-
 			// DevicePath
 			if (!devName.empty())
 			{

+ 3 - 1
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -825,7 +825,9 @@ void CDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 	}
 	else if (name == L"btn_diandan_qingkong")
 	{
-		CSystem::ShowKeyboardDeviceNames();
+		//纯粹用于调试物理键盘
+		//CSystem::ShowKeyboardDeviceNames();
+
 		this->ClickQingkong();
 	}
 	else if (name == L"btn_diandan_zhengdanbeizhu")