Re: Detecting shift/alt keys



> The onkeydown, onkeyup aren't issued for the "special" keys like
> shift, ctrl and alt.

Well they do OK in D3 on the form's OnKeyDown/Up. They certainly don't
in OnKeyPress because only an ASCII key will trigger that event
handler.

I usually use ...

if GetKeyState(VK_?????) < 0 then ...

for pressed

... and of course toggleable keys are ...

if Odd(GetKeyState(VK_INSERT)) then ...

for toggled on.

note that (at least in D3) the alpha-digit virtual-key codes (VK_A to
VK_Z etc) are not defined in Delphi.

Alan Lloyd

.