Re: Detecting shift/alt keys



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.

Dodgy.
--
MUSHROOMS ARE THE OPIATE OF THE MOOSES
.


Quantcast