wxJoystick::GetProductName() returns blank string on Windows (suggested fix attached) (Issue #23172)

18 views
Skip to first unread message

inkmeister

unread,
Jan 23, 2023, 1:04:37 PM1/23/23
to wx-...@googlegroups.com, Subscribed

On my system of 64-bit Windows 10 (22H2) with wxWidgets 3.2.1, wxJoystick::GetProductName() returns a blank string. This is due to the referenced registry keys not existing in HKEY_LOCAL_MACHINE but HKEY_CURRENT_USER. My simple fix was to replace the two instances of HKLM to HKCU in the aforementioned function.

Unfortunately I don’t know which version of Windows moved these keys, i.e. whether it’s also worth amending the function to try and read from HKCU first and then fall back to reading from HKLM.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23172@github.com>

VZ

unread,
Jan 24, 2023, 8:04:20 AM1/24/23
to wx-...@googlegroups.com, Subscribed

Unfortunately I don't know this neither and I don't even have any joysticks to test this with, but it looks that trying HKCU first and then falling back in HKLM would work just fine in any case, so if you'd like to make a PR changing the code to do it, I'd be glad to merge it.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23172/1401915700@github.com>

Maarten

unread,
Jan 24, 2023, 3:40:32 PM1/24/23
to wx-...@googlegroups.com, Subscribed

I can reproduce it with a controller. I need to use wxRegKey::HKCU as well.

I also noticed the joystick sample does not work anymore. It seems to require MSWDisableComposited (because of wxClientDC?) . And drawing doesn't look right at high DPI. I'll fix and update the sample. I can include the registry fix as well.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23172/1402618764@github.com>

VZ

unread,
Jan 25, 2023, 8:28:09 AM1/25/23
to wx-...@googlegroups.com, Subscribed

Closed #23172 as completed via ab12443.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23172/issue_event/8354767237@github.com>

Reply all
Reply to author
Forward
0 new messages