Yes, this will do it. I recommend grabbing a copy of ModifierKeys as
soon as the procedure starts, and then checking the copy throughout your
procedure as needed. On the off chance that your procedure is
long-running,
this will avoid a situation where the user has long since let go of the
key,
even though it was pressed at the actual time of the click.
Are you sure that's a concern? The docs are not clear about this, and
there are multiple ways in the underlying native Windows API to get the
information. Only if it's effectively calling GetAsyncKeyState() would it
be necessary to get a copy as soon as you enter the event handler.
I haven't been able to prove to myself that it's *not* necessary, but I'm
curious if you know for sure that it is. It seems to me that given the
design of .NET, it would make more sense for the ModifierKeys property to
act more like GetKeyState() or even return the state of the flags passed
to the mouse down messages (WM_LBUTTONDOWN, etc.)
Thanks,
Pete