Re: Detecting shift/alt keys
- From: Hanford Carr <"hwcarr<no spam>"@lmcinvestments.com>
- Date: Thu, 21 Apr 2005 13:32:07 -0400
"alanglloyd@xxxxxxx" wrote:
>
> > 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
They didn't bother to define them because they are the same as the
ASCII codes for the letters.
>From D5 windows.pas
{ VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' ($41 - $5A) }
Cheers Hanford
.
- References:
- Detecting shift/alt keys
- From: Peter
- Re: Detecting shift/alt keys
- From: Dodgy
- Re: Detecting shift/alt keys
- From: Peter
- Re: Detecting shift/alt keys
- From: Dodgy
- Re: Detecting shift/alt keys
- From: alanglloyd@xxxxxxx
- Detecting shift/alt keys
- Prev by Date: Re: Programming with COM port
- Next by Date: Re: Detecting shift/alt keys
- Previous by thread: Re: Detecting shift/alt keys
- Next by thread: Re: Detecting shift/alt keys
- Index(es):