mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
Attempted to fix issue #5
Added basic DS4 test code to tester application
This commit is contained in:
@@ -38,12 +38,19 @@ int main()
|
||||
|
||||
auto ret = vigem_connect(client);
|
||||
|
||||
#if X360
|
||||
const auto x360 = vigem_target_x360_alloc();
|
||||
|
||||
ret = vigem_target_add(client, x360);
|
||||
ret = vigem_target_add(client, x360);
|
||||
|
||||
ret = vigem_target_x360_register_notification(client, x360, ¬ification);
|
||||
ret = vigem_target_x360_register_notification(client, x360, ¬ification);
|
||||
#endif
|
||||
|
||||
const auto ds4 = vigem_target_ds4_alloc();
|
||||
|
||||
ret = vigem_target_add(client, ds4);
|
||||
|
||||
#if X360
|
||||
XUSB_REPORT report;
|
||||
XUSB_REPORT_INIT(&report);
|
||||
|
||||
@@ -54,8 +61,27 @@ int main()
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
DS4_REPORT report;
|
||||
DS4_REPORT_INIT(&report);
|
||||
|
||||
while (!(GetAsyncKeyState(VK_ESCAPE) & 0x8000))
|
||||
{
|
||||
ret = vigem_target_ds4_update(client, ds4, report);
|
||||
report.bThumbLX++;
|
||||
report.wButtons |= DS4_BUTTON_CIRCLE;
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
#if X360
|
||||
vigem_target_x360_unregister_notification(x360);
|
||||
vigem_target_remove(client, x360);
|
||||
vigem_target_free(x360);
|
||||
#endif
|
||||
|
||||
vigem_target_remove(client, ds4);
|
||||
vigem_target_free(ds4);
|
||||
|
||||
vigem_free(client);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user