Re: Detecting shift/alt keys
- From: Peter <peter@xxxxxxxxxxx>
- Date: Thu, 21 Apr 2005 15:40:02 +0100
On Thu, 21 Apr 2005 14:24:54 +0100, Dodgy
<Dodgy@xxxxxxxxxxxxxxxxxxxxx> wrote:
>On Thu, 21 Apr 2005 13:40:04 +0100, Peter <peter@xxxxxxxxxxx> waffled
>on about something:
>
>>Hi,
>>
>>I have a form with several controls.
>>
>>How do I detect when a user presses the shift or alt keys? I can't
>>seem to trap any keys using formkeypress or formkeydown.
>>
>>I have a couple of speed buttons and I want them to also be activated
>>on either a SHIFT or ALT key being pressed.
>>
>>Thanks.
>
> if HiWord(GetKeyState(vk_shift))<>0 then
> // it's down
> else
> // it's up
>
>The alt key is vk_menu
>
>Full list here.
>
>http://delphi.about.com/od/objectpascalide/l/blvkc.htm
>
>Hope this helps.
Thanks.
What I don't understand is where I should be checking. Form.onkeydown
and form.onkeypress don't seem to do anything.
Sorry but I'm a bit of a newbie to Delphi!
.
- Follow-Ups:
- Re: Detecting shift/alt keys
- From: Maarten Wiltink
- Re: Detecting shift/alt keys
- From: Dodgy
- Re: Detecting shift/alt keys
- References:
- Detecting shift/alt keys
- From: Peter
- Re: Detecting shift/alt keys
- From: Dodgy
- Detecting shift/alt keys
- Prev by Date: Re: Detecting shift/alt keys
- 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):