GetAsyncKeyState(VK_CONTROL)
I am trying to implement a multiple selection function but I seem to have some unintended ‘features’ ;).
First, what I would like to implement is to allow selection of multiple members by this combination:
Quote:
press ‘ctrl’ key - left click with mouse – release ‘ctrl’ key
this selects everything inline and to the right of the cursor as you can see in the attached picture.
Now the problem, if I were to left click with the mouse in the same spot again my program acts as if the ‘ctrl’ key is depressed. Is this from a keyup message from my previous selection? If so how do I get rid of it?
Second, if I press
Quote:
‘ctrl’ – release ‘ctrl’ – and then left click
my program seems to behave the way I intend but with the wrong combination of keys.
Here is a snippet of code that I am working with:
Code:
case WM_LBUTTONDOWN:
{ //…misc code…
if(GetAsyncKeyState(VK_CONTROL))
{
RayTestHorizontal(head, LeftClick);// multi-select inline and right of cursor.
}
else
FindMember(LeftClick); // just selects one member.
Thanks in advance for any pointers to help me out.