Hey,
I’m trying to select multiple items in a TableListBox in a plug-in on Windows 10 and haven’t had much success. “setMultipleSelectionEnabled” is set to true on the table in question, and interestingly the same project with no code alterations selects items in the table with command and shift without any problems on OS X.
Using a debugger to see where the modifier keys are set and how they react to windows mouse events, I noticed a few things:
-
“updateModifiersFromWParam” receives a value of 5 when the mouse is clicked with shift down, and 1 when it is clicked normally, but the function itself only handles left, right, and center click, effectively ignoring the alternative value indicating a modifier.
-
GetAsyncKeyState, and consequentially isKeyDown(VK_SHIFT), continually returns false. Poking around the MSDN, I found the following note about this function which seems to imply that it cannot be used reliably in plug-in UI?
The return value is zero for the following cases:
The current desktop is not the active desktop
The foreground thread belongs to another process and the desktop does not allow the hook or the journal record.
In other words with GetAsyncKeyState you can only monitor keyboard events that belong to your app.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/fbe9b69b-6848-4346-a393-1bfa7ea5a8e2/getasynckeystate-always-return-zero-in-window-service-in-window-7?forum=csharpgeneral
Does anyone have any suggestions about how to proceed? It seems like there’s something intrinsic to JUCE’s relationship with Win 10 specifically, and I don’t want to modify the JUCE source without a deeper understanding the potential repercussions of doing so.