Board index » delphi » KeyDown Working...Not Working

KeyDown Working...Not Working

In the OnKeyDown event of a form I have place the following code:

if (ssCtrl in Shift) and (Key = VK_LEFT) then do something

On this form I also have a PopUpMenu Item and I discovered when I use
the PopUpMenu my code does not work. If I use the PopUpMenu again then
my code works and so on.

What seams to be the problem???

Patrick Gentemann

 

Re:KeyDown Working...Not Working


Patrick -

Typically a form has a bunch of controls on it. The one with the focus
may be "eating" the left arrow. What controls do you have and which
one is gobbling that character?

Good luck.

Kurt

Re:KeyDown Working...Not Working


Quote
Kurt Barthelmess (TeamB) wrote:
> Typically a form has a bunch of controls on it. The one with the focus
> may be "eating" the left arrow. What controls do you have and which
> one is gobbling that character?

None of the other controls have codes on it so no one is "eating" in
this case Ctrl key because the left arrow still works. The command works
just find until I use a PopUpMenu. Once the PopUpMenu is used than it's
funny land.

Patrick

Re:KeyDown Working...Not Working


Quote
Patrick Gentemann <pg...@ibm.net> writes: > In the OnKeyDown event of a form I have place the following code:

> if (ssCtrl in Shift) and (Key = VK_LEFT) then do something

> On this form I also have a PopUpMenu Item and I discovered when I use
> the PopUpMenu my code does not work. If I use the PopUpMenu again then
> my code works and so on.

> What seams to be the problem???

> Patrick Gentemann

Try to place processing not in the OnKeyDown event but OnKeyUp.
Maybe can help.

Re:KeyDown Working...Not Working


Patrick -

Sorry, I don't know what to say. It works fine for me.

Good luck.

Kurt

Other Threads