Thanx to rob for straightening me out on the differences between
GetKeycode and GetAsynchKeycode. I had their uses reversed! Now I have
another similar question that I've been trying to find the optimum solution
for.
I need to select an icon representing a number of database records
in a TListview. When selected, I want to be able to use a keyboard command
such as Shift + A, Shift + B, Shift + C, and Shift + C to begin the
execution of either of four files whose paths and names are found in the
database and relate to selected listings as Filename A, Filename B, Filename
C, and Filename D. Unfortunately I don't seem to be able to do this because
the TListview takes advantage of alphabetic keys such that clicking "A"
would automatically take you to the first Item in the ListView whose caption
begins with "A", and the same with B, C, and D. I thought perhaps using an
OnKeyDown event and the virtual key codes such as VK_Shift + Ord('A') would
over-ride the default behaviour but it does not in either the ListView's
OnKeyDown or the form's when KeyPreview is set to True. I don't want to
lose this default behaviour, so does anyone know a way to over-ride it in
this particular situation?
Next I thought of altering the filename Keys to be listed as
filenames 1 thru 4 and using the Virtual key codes like VK_SHIFT + VK_F1,
VK_SHIFT + VK_F2, VK_SHIFT + VK_F3, and VK_SHIFT + VK_F4, which would be
just as easy or maybe easier for a user to remember. But I cannot get these
combinations to work either with the ListView and/or the Form. Is there
some trick to using Keydown shortcuts on a TListview, especially when
combining two or more virtual key codes together? I've already tried, "if
(key = VK_SHIFT) and (VK_F1) then", but this doesn't work for the Form or
the Listview either. Any ideas?
from Robert Meek dba Tangentals Design CCopyright 2006
"When I examine myself and my methods of thought, I come to the conclusion
that the gift of Fantasy has meant more to me then my talent for absorbing
positive knowledge!"
Albert Einstein
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi